Useful Links to Original Articles Please visit " Original Links " at the end of the article for clickable in-text links, full-size original images and related articles. Acknowledgments Compiled from | https://www.networkworld.com/article/3235219/linux/scary-linux-commands-for-halloween.html
Author | Sandra Henry-stocker
Translator | geekpi ? ? Total translation: 696 contributions : 1635 days
While it's not Halloween, pay attention to the scary side of Linux. What commands might show images of ghosts, witches, and zombies? Which encourages the "trick or treat" spirit?
crypt
Well, we see it all the time crypt
. Despite its different name, crypt is not a cellar, nor a burial pit of junk files, but a command that encrypts the contents of a file. Now, this crypt
is usually implemented with a script that does its job by invoking a mcrypt
binary called simpy to emulate the previous command. crypt
Using the mycrypt
command directly is a better option.
$ 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.
Note that the mcrypt
command creates a file with a second extension .nc
. It will not overwrite the file you are encrypting.
mcrypt
The command has options for key size and encryption algorithm. You can also specify keys in options, but mcrypt
this is discouraged by the command.
kill
There are also kill
commands - certainly not referring to murder, but are used to forcibly and non-coercively end processes, depending on the requirement to terminate them properly. Of course, Linux doesn't stop there. Instead, it has various kill
commands to kill the process. We have kill
, pkill
, killall
, killpg
, rfkill
, skill
( ) (pronounced es-kill), tgkill
, tkill
and xkill
.
$ killall runme
[1] Terminated ./runme
[2] Terminated ./runme
[3]- Terminated ./runme
[4]+ Terminated ./runme
shred
Linux systems also support a shred
command called . shred
The command overwrites files to hide their previous contents and ensure they cannot be recovered using hard drive recovery tools. Remember that the rm
command basically just removes the file's reference in the directory file, but doesn't necessarily delete the content from disk or overwrite it. shred
The command overwrites the contents of the file.
$ shred dupes.txt
$ more dupes.txt
▒oΛ▒▒9▒lm▒▒▒▒▒o▒1־▒▒f▒f▒▒▒i▒▒h^}&▒▒▒{▒▒
zombie
Although not a command, zombies are very persistent on Linux systems. Zombies are basically the remains of dead processes that haven't been cleaned up completely. Processes are not supposed to work this way - let dead processes wander around instead of simply letting them die and enter the digital paradise, so the presence of zombies shows that the processes that leave them here have some flaws.
An easy way to check your system for zombie processes left over is to look at top
the command's header line.
$ 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
horrible! The above shows three zombie processes.
at midnight
It is sometimes said on Halloween, when the spirits of the dead wander from sunset until midnight. Linux can at midnight
track their departure via commands. Used to schedule a job to run the next time the specified time arrives, at
acts like a one-time cron.
$ at midnight
warning: commands will be executed using /bin/sh
at> echo 'the spirits of the dead have left'
at> <EOT>
job 3 at Thu Oct 31 00:00:00 2017
daemon
Linux systems are also highly dependent on daemons - processes that run in the background and provide many of the system's functions. Many daemons have names ending in "d". The "d" stands for daemon, indicating that this process is always running and supports some important functions. Some will use the word "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
Happy Halloween!
on Facebook[1] and LinkedIn[2] Join the Network World community on to comment on topics.
via: https://www.networkworld.com/article/3235219/linux/scary-linux-commands-for-halloween.html
Author: Sandra Henry-Stocker[4] Translator: geekpi Proofreading: wxy
This article is originally compiled by LCTT , and launched by Linux China with honor