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

How to reduce the root directory of XFS partition format in Linux

Table of contents Preface System environment Curr...

How to prohibit vsftpd users from logging in through ssh

Preface vsftp is an easy-to-use and secure ftp se...

Detailed explanation of Linux text editor Vim

Vim is a powerful full-screen text editor and the...

MySQL trigger simple usage example

This article uses examples to illustrate the simp...

Summary of Common Mistakes in Web Design

In the process of designing a web page, designers...

HTML uses form tags to implement the registration page example code

Case Description: - Use tables to achieve page ef...

MySQL 8.0.12 Installation and Configuration Tutorial

This article records the detailed tutorial for in...

Several ways to implement CSS height changing with width ratio

[Solution 1: padding implementation] principle: I...

Detailed steps for installing MinIO on Docker

Table of contents 1. Check whether the docker env...

Vue-cli creates a project and analyzes the project structure

Table of contents 1. Enter a directory and create...

The pitfall record of case when judging NULL value in MySQL

Table of contents Preface Mysql case when syntax:...

How to control the startup order of docker compose services

summary Docker-compose can easily combine multipl...

js implements the algorithm for specifying the order and amount of red envelopes

This article shares the specific code of js to im...

A brief analysis of the use of watchEffect in Vue3

Preface Everyone should be familiar with the watc...

Detailed tutorial on installing mysql 5.7.26 on centOS7.4

MariaDB is installed by default in CentOS, which ...