Scary Halloween Linux Commands

Scary Halloween Linux Commands

Even though it's not Halloween, it's worth focusing on the spooky side of Linux. What command might display images of ghosts, witches, and zombies? Which will encourage the spirit of trick or treating?

crypt

Well, we see crypt all the time. Despite the name, crypt is not a vault or a burial pit for junk files, but a command that encrypts the contents of files. Today, crypt is usually implemented as a script that does its work by calling a binary called mcrypt that emulates the old crypt command. Using the mycrypt command directly is a better choice.

$ 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 second file with a .nc extension. It will not overwrite the files you are encrypting.

The mcrypt command has options for key size and encryption algorithm. You can also specify the key in options, but the mcrypt command discourages this.

kill

There is also the kill command - not meant to murder, of course, but to kill processes both forcibly and non-forcibly, depending on the requirements to terminate them properly. Of course, Linux doesn't stop there. Instead, it has various kill commands to terminate processes. 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 command called shred. The shred command overwrites files to hide their previous contents and ensure that they cannot be recovered using hard drive recovery tools. Remember that the rm command basically just removes the reference to the file in the directory file, but does not necessarily delete the content from disk or overwrite it. The shred command overwrites the contents of a file.

$ shred dupes.txt
$ more dupes.txt
▒oΛ▒▒9▒lm▒▒▒▒▒▒o▒1־▒▒f▒f▒▒▒i▒▒h^}&▒▒▒{▒▒

Zombies

Although not a command, zombies are a very stubborn presence on Linux systems. Zombies are basically the remains of dead processes that were not fully cleaned up. Processes aren't supposed to work this way - having dead processes hanging around instead of simply letting them die and go to digital heaven, so the existence of zombies indicates that there's something wrong with the process that's letting them stay here.

An easy way to check if your system has any zombie processes left is to look at the header line of the top command.

$ 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! It shows that there are three zombie processes.

at midnight

It is sometimes said on Halloween that the spirits of the dead wander from sunset until midnight. Linux can track their departure with the at midnight command. Used to schedule a job to run at the next specified time. 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 also rely heavily on daemons—processes that run in the background and provide much of the system's functionality. 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 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

Summarize

The above are the scary Halloween Linux commands that I introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time!

You may also be interested in:
  • 10 Popular Windows Apps That Are Also Available on Linux
  • Detailed explanation of Win10 Bash/WSL debugging .NET Core applications in Linux environment
  • How to use Crontab to regularly monitor and maintain Tomcat applications in Linux
  • Running Windows Applications on Linux
  • Detailed tutorial on compiling and installing python3.6 on linux
  • Tutorial on configuring and using i3 window manager in Linux
  • 10 reasons why Linux is becoming more and more popular
  • 27 Linux document editing commands worth collecting
  • 11 Linux KDE applications you didn't know about

<<:  JavaScript to achieve the effect of clicking on the submenu

>>:  MySQL-group-replication configuration steps (recommended)

Recommend

Implementation of MySQL Multi-version Concurrency Control MVCC

Table of contents What is MVCC MVCC Implementatio...

Font Treasure House 50 exquisite free English font resources Part 1

Designers have their own font library, which allo...

Brief introduction and usage of Table and div

Web front end 1 Student ID Name gender age 01 Zha...

Problems encountered in the execution order of AND and OR in SQL statements

question I encountered a problem when writing dat...

HTML code example: detailed explanation of hyperlinks

Hyperlinks are the most frequently used HTML elem...

Example of how to upload a Docker image to a private repository

The image can be easily pushed directly to the Do...

Some basic instructions of docker

Table of contents Some basic instructions 1. Chec...

Native JS to achieve cool paging effect

This article uses an example to share with you a ...

Solve the problem of insufficient docker disk space

After the server where Docker is located has been...

Summary of some small issues about MySQL auto-increment ID

The following questions are all based on the Inno...

Detailed Analysis of Explain Execution Plan in MySQL

Preface How to write efficient SQL statements is ...

Tomcat+Mysql high concurrency configuration optimization explanation

1.Tomcat Optimization Configuration (1) Change To...

Analyze the usage and principles of Vue's provide and inject

First, let's talk about why we use provide/in...

How to install MySQL Community Server 5.6.39

This article records the detailed tutorial of MyS...