MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Common UNIX Commands and Utilities: Practical Reference for DevOps and Sysadmin Work

UNIX command-line literacy is foundational for DevOps and operations work, from inspecting logs and managing files to troubleshooting processes and automating recurring tasks. This revised guide turns the original command list into a practical reference you can use during daily terminal work.

Originally published on 2011-01-05; fully revised and updated.

unix commands and utilities

Find commands quickly with built-in documentation

When you do not remember the exact command name, use man -k with a keyword. Then open the manual page for the command you want. GNU tools may also include additional info documentation.

man -k tape
man tar
man csh
info ls
history | tail -20

A safe workflow for using unfamiliar commands

flowchart TD
    A[Need a command] --> B[Search with man -k keyword]
    B --> C[Read man or info page]
    C --> D[Run on test file or test path]
    D --> E{Output expected}
    E -- no --> F[Refine options and retry]
    F --> C
    E -- yes --> G[Automate with script cron or alias]
    G --> H[Use in production task]

UNIX command groups at a glance

Task areaCommands from the original guideTypical use
Login and authenticationlogin, logout, passwd, kinit, kdestroySession access and credential handling
System informationdate, history, man, info, who, whoami, top, uptimeHost state and user context
Files and directoriesls, cp, mv, rm, ln, chmod, find, cd, mkdir, rmdir, pwdEveryday file lifecycle tasks
File display and comparisoncat, more, head, tail, grep, diff, cmp, comm, wc, file, strings, odInspect, search, and compare data
Disk and archivesdf, du, gzip, gunzip, tar, ddCapacity checks, compression, archiving
Execution controljobs, ps, kill, nice, at, crontab, fg, bg, alias, limitForeground/background jobs and scheduling
Networkingssh, scp, sftp, host, lynx, telnet, ftpRemote access and transfers
Text and data processingsed, awk, perl, sort, tr, cut, paste, fmt, foldStream editing and structured text handling
Editors and build toolsvi, emacs, xemacs, pico, gcc, g++, make, dbx, cflowEditing, compiling, and builds
Printing and document toolinglpr, lpq, lprm, enscript, tex, latex, dvips, xdviPrint queues and document workflows

For password changes with passwd, follow strong password guidance (original external reference): strong password practices.

C-shell control keys, symbols, and job control

The original article is C-shell oriented in several sections. If you use Bash or Zsh, behavior and key bindings may differ. Also see the linked reference for shell-special filename characters: special characters to avoid in filenames.

Terminal control characters (C-shell)

KeyEffect
Ctrl+H (or Backspace)Erase previous character
Ctrl+UErase current input line
Ctrl+DEnd input for terminal-reading programs
Ctrl+SPause terminal output
Ctrl+QResume terminal output
Ctrl+ZSuspend current foreground job
Ctrl+CInterrupt current foreground program
Ctrl+\Forceful quit of current foreground program

Special symbols and I/O operators

Symbol or commandMeaning
*Wildcard for filename matching
~userUser home-directory shorthand
$nameVariable substitution
\Escape next special character
‘…’Single-quote literal string
“…”Double-quote string with variable expansion
`…`Command substitution (legacy syntax)
|Pipe stdout to next command
>Redirect stdout to file
<Read stdin from file
>>Append stdout to file
jobs, fg, bg, killJob listing, resume, background, terminate
sleep 300 &
jobs
fg %1
grep 'ERROR' app.log | tee errors.log
sort app.log > sorted.log
wc -l < sorted.log
./rotate-logs.sh >> ops.log 2>&1Code language: HTML, XML (xml)

File, directory, and disk operations

CommandPrimary useExample
lsList files and metadatals -al
cpCopy filescp source.txt backup.txt
mvMove or renamemv old.log archive.log
rmDelete filesrm -i old.log
lnCreate additional link nameln app.log latest.log
chmodChange permissionschmod 640 secrets.txt
findSearch by criteriafind . -name ‘*.conf’ -type f
df / duFilesystem free space and usagedf -h ; du -sh ./data
gzip / gunzipCompress and decompressgzip logs.txt
tarArchive directories/filestar -czf release.tgz ./release
pwd
ls -al
mkdir -p archive/2026
cp app.log archive/2026/
mv archive/2026/app.log archive/2026/app.log.1
find archive -name '*.log*' -type f
du -sh archive
df -hCode language: JavaScript (javascript)

Display, compare, and inspect file contents

CommandBest forNotes
catQuick file outputGood for short files and pipelines
morePaged terminal viewingUseful on long text output
head / tailStart or end of filesCommon for log triage
grepPattern matchingFilter lines by regex/text
diffLine-level text differencesUseful for config comparisons
cmpBinary-level comparisonReports whether files differ
commCommon/unique linesCompares sorted text files
wcCounts lines/words/charsQuick volume checks
fileGuess file typeHelpful before parsing unknown files
strings / odInspect binary contentExtract printable text or octal/hex views
head -n 20 /var/log/syslog
tail -n 50 /var/log/syslog
grep -n 'ERROR' app.log
diff -u old.conf new.conf
wc -l app.log
file /bin/ls
strings /bin/ls | headCode language: JavaScript (javascript)

Networking and remote transfer commands

CommandSecurity profileTypical use
sshEncryptedRemote shell and command execution
scpEncryptedNon-interactive file copy
sftpEncryptedInteractive file transfer session
telnetPlaintext credentialsLegacy remote login; generally not recommended
ftpPlaintext credentialsLegacy transfer method; generally not recommended
hostN/ADNS lookup for host/IP mapping
lynxN/AText-mode web browsing
ssh devops@example-host
scp release.tgz devops@example-host:/tmp/
sftp devops@example-host
host example.comCode language: CSS (css)

Text processing, editors, and programming tools

AreaCommandsUse case
Stream editingsedBatch substitutions and line transforms
Pattern processingawkColumn-aware text processing
General scriptingperlPowerful text and report extraction
Column utilitiescut, paste, tr, sortReshape delimiter-based data
Editorsvi, emacs, xemacs, picoInteractive file editing in terminal/X
Compilers and buildsgcc, g++, make, dbx, cflowCompile, debug, and rebuild source code
Shell interpreterssh, csh, kshRun shell scripts in matching shell syntax
cut -d',' -f1 users.csv | sort
awk '{print $1, $3}' metrics.txt
sed 's/ERROR/WARN/g' app.log > app.log.rewritten
gcc -o hello hello.c
makeCode language: JavaScript (javascript)

Legacy and environment-specific utilities from the original list

  • Kerberos commands: kinit, kdestroy
  • Email and bulletin tools: mailx, msgs, uuencode, uudecode, rn
  • X Window clients: xterm, xauth, xload, xman, xdvi, gv
  • TeX toolchain: tex, latex, dvips, latex2html
  • Tape/archive operations: mt, dd, tar, ltf
  • Scientific/programming libraries and tools listed: lapack, dbm, xdr, netcdf, f77, f2c

Best practices and common pitfalls

  • Use man (and man -k) before running unfamiliar commands on production paths.
  • Prefer ssh, scp, and sftp over plaintext protocols like telnet and ftp.
  • Be careful with destructive commands (rm, mv, dd); test on sample data first.
  • Verify which shell you are in; C-shell behavior can differ significantly from Bash/Zsh.
  • Use redirection and logging deliberately so command output is auditable (>>, tee, 2>&1).
  • Expect command availability to vary across UNIX/Linux environments, especially for legacy tools.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Shell Scripting Interview Questions, Explained: Bash Fundamentals, UNIX Processes, and Practical Commands

A modernized, interview-focused guide to shell scripting and core UNIX concepts for DevOps engineers. Learn command execution flow, redirection, permissions, process control, IPC, and safe scripting patterns with practical examples.

Read More

Shell script to Print only Size and file name using unix command.

rajeshkumar created the topic: Shell script to Print only Size and file name using unix command. Shell script to Print only Size and file name using unix…

Read More

Shell Bash Scripting: Assignment & Excercise – 7

This exercise uses Bash, rsync and SSH to copy a local file to a remote backup server, then sends an email when the copy finishes. Below the…

Read More

Shell Bash Scripting: Assignment & Excercise – 4

This exercise asks for a Bash script that checks CPU usage and sends an email when it goes over a threshold. The script above reads /proc/stat, but…

Read More

Shell Scripting Tutorials: Function

A Bash function is a named block of commands that takes arguments as $1, $2, … and $@, and hands results back through its output or its…

Read More

Shell Scripting Tutorials: Looping & Iteration statatement using for until

An until loop in shell scripting keeps running its body for as long as a test command fails (returns a non-zero exit status), and stops as soon…

Read More
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Puja kushwaha
Puja kushwaha
27 days ago

Learning Unix commands becomes easier when you practice them on real tasks instead of memorizing lists. Commands like grep, find, and sort can help you search files and manage data faster. It is also useful to understand command options and read error messages carefully. Before using commands that delete or change files, check the target path and review the command. Which Unix commands do you find most useful for daily troubleshooting?

1
0
Would love your thoughts, please comment.x
()
x