search

6 'scary” Linux commands

Aug 03, 2023 pm 04:33 PM
linuxlinux command

##text
#
$ mcrypt x
Enter the passphrase (maximum of 512 characters)
Please use a combination of upper and lower case letters and numbers.
Enter passphrase:
Enter passphrase:
File x was encrypted.

Please note: The mcrypt command will create a second file with the extension ".nc".

It does not overwrite the files you are encrypting. The mcrypt command has options for key size and encryption algorithm. You can also specify a key as an option, but this is discouraged by the mcrypt command.

kill

6 'scary” Linux commands

There is also the kill command - of course this does not refer to murder, but to the command we use to terminate the process. The termination methods are How tough depends on what is needed to terminate them appropriately. Of course, Linux doesn't stop there. Instead, it has a variety of kill commands to use on your command line.

Search the public account Linux Chinese community backend and reply "command line" to get a surprise gift package.

We have kill, pkill, killall, killpg, rfkill, skill (see es-kill), tgkill, tkill and xkill.

$ killall runme

[1] Terminated ./runme
[2] Terminated ./runme
[3]- Terminated ./runme
[4]+ Terminated ./runme

shred

6 'scary” Linux commands

Linux系统还支持一种名为shred的命令。shred命令覆盖文件以隐藏以前的内容,并确保无法使用硬盘恢复工具来恢复它们。请记住:rm命令基本上只是删除目录文件中的文件引用,但不一定从磁盘上擦除内容或覆盖内容。shred命令才是覆盖文件的内容。

$ shred dupes.txt

$ more dupes.txt

▒oΛ▒▒9▒lm▒▒▒▒▒o▒1־▒▒f▒f▒▒▒i▒▒h^}&▒▒▒{▒▒

zombies

6 'scary” Linux commands

虽然zombies(僵尸进程)不是一个命令,但它在Linux系统上却根深蒂固。zombies基本上是没有被完全清除的死亡进程的残骸。

进程不应该以这种方式运行——任由死亡进程逗留,而不是仅仅让它们死亡、进入数字天堂,所以zombies的存在表明了留下它们的进程存在某种缺陷。

检查你的系统是否有僵尸进程残留下来,一个简单的方法就是查看top命令的标题行。

好吓人!上面显示有三个僵尸进程。

$ top

top - 18:50:38 up 6 days, 6:36, 2 users, load average: 0.00, 0.00, 0.00

Tasks: 171 total, 1 running, 167 sleeping, 0 stopped, 3 zombie <==

%Cpu(s): 0.0 us, 0.0 sy, 0.0 ni, 99.9 id, 0.1 wa, 0.0 hi, 0.0 si, 0.0 st

KiB Mem : 2003388 total, 250840 free, 545832 used, 1206716 buff/cache

KiB Swap: 9765884 total, 9765764 free, 120 used. 1156536 avail Mem

at midnight

死人的灵魂会从日落一直游荡到深夜。Linux让用户可以借助“at midnight”命令跟踪是否已离开。at用来安排下一次指定时间到来时就运行的任务,工作方式类似一次性计划任务(cron)。

$ at midnight

warning: commands will be executed using /bin/sh

at> echo &#39;the spirits of the dead have left&#39;

at> <EOT>

job 3 at Thu Oct 31 00:00:00 2017

daemons

6 'scary” Linux commands

Linux系统还高度依赖守护进程(daemon)——这种进程在后台运行,提供了系统的许多功能。许多守护进程的名称以“d”结尾。这个“d”代表“daemon”,它表明该进程一直运行,支持某种重要功能。另一些守护进程则将“daemon”这个单词拼出来。

$ ps -ef | grep sshd

root 1142 1 0 Oct19 ? 00:00:00 /usr/sbin/sshd -D

root 25342 1142 0 18:34 ? 00:00:00 sshd: shs [priv]

$ ps -ef | grep daemon | grep -v grep

message+ 790 1 0 Oct19 ? 00:00:01 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation

root 836 1 0 Oct19 ? 00:00:02 /usr/lib/accountsservice/accounts-daemon

The above is the detailed content of 6 'scary” Linux commands. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:Linux中文社区. If there is any infringement, please contact admin@php.cn delete
How to audit file accessHow to audit file accessAug 08, 2025 am 06:04 AM

Audit file access requires recording the visitor, time and operation, and is implemented through system settings and tools. 1. Enable the system's own audit function, such as Windows configures object access audit in "local security policy", and Linux uses auditd to add monitoring rules; 2. Use third-party tools such as SolarWinds or OSSEC to collect logs, automatically alarms and generate reports; 3. Set reasonable permissions, assign access controls according to roles, clean invalid permissions regularly, and restrict access to key folders; 4. Protect log storage, store them in an independent server or read-only location, enable the rotation mechanism and restrict log access rights, and ensure data integrity.

How to configure Samba serverHow to configure Samba serverAug 08, 2025 am 03:36 AM

The key to configuring a Samba server is to master the steps of installation, configuration file editing, user addition and service startup. 1. Install Samba: Select apt, yum or dnf commands according to the system for installation; 2. Edit the smb.conf file, set global parameters such as workgroup and security, and define the path, permissions of the shared directory, etc.; 3. Use smbpasswd to add Samba user and set password; 4. Start the smbd service and set the power-on self-start, and then pass Windows access test; 5. When encountering connection problems, check whether the firewall, service status, configuration restrictions and username and password are correct. Pay attention to permission mask, user mapping and configuration syntax throughout the process

How to use `dmesg` to view kernel messagesHow to use `dmesg` to view kernel messagesAug 08, 2025 am 02:53 AM

Thedmesgcommandisusedtoviewandfilterkernelmessagesfortroubleshooting;itsupportsreal-timemonitoring,severity-basedfiltering,andhuman-readabletimestamps.Todisplayallmessages,rundmesg|less;filterbyseverityusing-lwithlevelslikeerrorwarn;enablereadabletim

How to configure fstab for automatic mountingHow to configure fstab for automatic mountingAug 08, 2025 am 02:31 AM

The key to configuring fstab to achieve automatic mount is to understand the role of each parameter and set it correctly. 1. Each line of fstab contains six fields: device identity (filesystem), mountpoint (mountpoint), file system type (type), mount options (options), dump and pass. 2. It is recommended to use UUID instead of device name to avoid problems caused by changes in device order. You can view UUID through the blkid command. 3. Common mount options include defaults, auto, noauto, user, nouser, exec, noexec, ro, rw, etc. If you are NTFS or FAT format, it is recommended to add utf8 parameter support.

How to configure syslog daemonHow to configure syslog daemonAug 07, 2025 am 08:37 AM

To configure syslogdaemon, you must first confirm the service type, and then modify the rules and forwarding settings. 1. Use ps or systemctl to confirm using rsyslog or syslog-ng; 2. Edit /etc/rsyslog.conf to add log classification rules such as auth./var/log/auth.log; 3. Add forwarding rules to the client.*@@Remote IP:514 and enable the listening module on the server; 4. Configure the log rotation policy through logrotate, such as daily rotation for 7 days, and finally restart the service and check the firewall and permissions issues.

How to restart systemd serviceHow to restart systemd serviceAug 07, 2025 am 08:00 AM

To restart the systemd service, you need to use the correct commands and methods. 1. The basic operation is the sudosystemctlrestart service name, if it takes effect after modifying the configuration; 2. After restarting, check the status and use systemctlstatus or is-active to confirm the operation status; 3. If it fails, check the log journalctl-u service name-b and troubleshoot the configuration, port, and permissions; 4. Try to stop first and then restart after starting or killing the process; 5. You can enable watchdog automatic restart, and service support is required and the WatchdogSec and Restart options are configured in the unit file.

How to build a Docker imageHow to build a Docker imageAug 07, 2025 am 07:44 AM

The key to building a Docker image is to understand the process and write a Dockerfile well. 1. Use official basic images as the starting point to ensure stability; 2. Merge the command line to reduce the number of mirror layers to improve efficiency; 3. Use the .dockerignore file to eliminate useless files to speed up construction; 4. Be familiar with the construction commands such as dockerbuild-t specifying tags; 5. Optional --no-cache, --build-arg and multi-stage building optimization process; 6. Run the container test startup status after building, enter the container to check files and view the log to troubleshoot problems; 7. Optimize the image size and dependency cleaning if necessary. Through the above steps, a clean, safe and efficient mirror can be created.

How to manage disk quotasHow to manage disk quotasAug 07, 2025 am 02:45 AM

The key to managing disk quotas is to understand the system mechanism, set appropriate restrictions, and continuously monitor usage. First, we must clarify the basic types of disk quotas, including user-based quotas, group-based quotas, and software and hard-core limitations, and understand the support methods of different operating systems (such as Linux and Windows Server); second, enabling quotas in Linux requires ensuring file system support, enabling quota options when mounted, creating quota databases and enabling services. At the same time, user quotas can be edited or copied through the edquota command; third, continuously monitoring quota usage, regularly viewing reports, setting email reminders and grace periods, and combining tools such as Nagios and Zabbix to achieve automated alarms; finally, on Wi

See all articles

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!