Linux Command Overview: crypt, kill, shred, zombies, at midnight, and daemons
This article introduces several essential Linux commands—including crypt (via mcrypt), various kill utilities, shred for secure deletion, zombie process identification, the at scheduler, and daemon management—explaining their purposes, usage examples, and relevant options for system administrators.
The crypt command encrypts file contents; modern implementations invoke the mcrypt binary to simulate the older crypt utility, creating an additional file with a .nc extension without overwriting the original, and offering options for key size and algorithm.
Example usage:
$ mcrypt x<br/>Enter the passphrase (maximum of 512 characters)<br/>Please use a combination of upper and lower case letters and numbers.<br/>Enter passphrase:<br/>Enter passphrase:<br/>File x was encrypted.The kill family of commands terminates processes, with variants such as kill, pkill, killall, killpg, rfkill, skill, tgkill, tkill, and xkill. An example of terminating all instances of a program:
$ killall runme<br/><br/>[1] Terminated ./runme<br/>[2] Terminated ./runme<br/>[3]- Terminated ./runme<br/>[4]+ Terminated ./runmeThe shred command securely overwrites a file to prevent data recovery, unlike rm which merely removes directory entries. Example:
$ shred dupes.txt<br/><br/>$ more dupes.txt<br/><br/>▒oΛ▒▒9▒lm▒▒▒▒▒o▒1־▒▒f▒f▒▒▒i▒▒h^}&▒▒▒{▒▒Zombie processes are defunct processes that remain after their parent fails to reap them. They can be identified by the top command, which lists them in the “Tasks” line. Example output shows three zombie processes:
$ top<br/><br/>top - 18:50:38 up 6 days, 6:36, 2 users, load average: 0.00, 0.00, 0.00<br/><br/>Tasks: 171 total, 1 running, 167 sleeping, 0 stopped, 3 zombie <==<br/>%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<br/>KiB Mem : 2003388 total, 250840 free, 545832 used, 1206716 buff/cache<br/>KiB Swap: 9765884 total, 9765764 free, 120 used. 1156536 avail MemThe at midnight command schedules a one‑time job to run at the specified time, similar to a single‑execution cron job. Example:
$ at midnight<br/><br/>warning: commands will be executed using /bin/sh<br/>at> echo 'the spirits of the dead have left'<br/>at> <EOT><br/><br/>job 3 at Thu Oct 31 00:00:00 2017Daemons are background processes that provide core system services; many end with a “d” (e.g., sshd, dbus-daemon). They can be listed with ps -ef | grep daemon while excluding the grep process itself.
$ ps -ef | grep sshd<br/><br/>root 1142 1 0 Oct19 ? 00:00:00 /usr/sbin/sshd -D<br/>root 25342 1142 0 18:34 ? 00:00:00 sshd: shs [priv]<br/><br/>$ ps -ef | grep daemon | grep -v grep<br/><br/>message+ 790 1 0 Oct19 ? 00:00:01 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation<br/>root 836 1 0 Oct19 ? 00:00:02 /usr/lib/accountsservice/accounts-daemonSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Python Programming Learning Circle
A global community of Chinese Python developers offering technical articles, columns, original video tutorials, and problem sets. Topics include web full‑stack development, web scraping, data analysis, natural language processing, image processing, machine learning, automated testing, DevOps automation, and big data.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
