{"id":293,"date":"2026-10-13T09:52:30","date_gmt":"2026-10-13T09:52:30","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2011\/01\/05\/common-unix-commands-and-utilities\/"},"modified":"2026-10-13T09:52:31","modified_gmt":"2026-10-13T09:52:31","slug":"common-unix-commands-and-utilities","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/common-unix-commands-and-utilities\/","title":{"rendered":"Common UNIX Commands and Utilities: Practical Reference for DevOps and Sysadmin Work"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Originally published on 2011-01-05; fully revised and updated.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2011\/01\/unix-commands-and-utilities.png\" alt=\"unix commands and utilities\" \/><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Find commands quickly with built-in documentation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When you do not remember the exact command name, use <code>man -k<\/code> with a keyword. Then open the manual page for the command you want. GNU tools may also include additional <code>info<\/code> documentation.<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs language-bash\">man -k tape\nman tar\nman csh\ninfo ls\nhistory | tail -20<\/code><\/span><\/pre>\n\n\n<h2 class=\"wp-block-heading\">A safe workflow for using unfamiliar commands<\/h2>\n\n\n\n<pre class=\"mermaid\">\nflowchart TD\n    A[Need a command] --> B[Search with man -k keyword]\n    B --> C[Read man or info page]\n    C --> D[Run on test file or test path]\n    D --> E{Output expected}\n    E -- no --> F[Refine options and retry]\n    F --> C\n    E -- yes --> G[Automate with script cron or alias]\n    G --> H[Use in production task]\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">UNIX command groups at a glance<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Task area<\/th><th>Commands from the original guide<\/th><th>Typical use<\/th><\/tr><\/thead><tbody><tr><td>Login and authentication<\/td><td>login, logout, passwd, kinit, kdestroy<\/td><td>Session access and credential handling<\/td><\/tr><tr><td>System information<\/td><td>date, history, man, info, who, whoami, top, uptime<\/td><td>Host state and user context<\/td><\/tr><tr><td>Files and directories<\/td><td>ls, cp, mv, rm, ln, chmod, find, cd, mkdir, rmdir, pwd<\/td><td>Everyday file lifecycle tasks<\/td><\/tr><tr><td>File display and comparison<\/td><td>cat, more, head, tail, grep, diff, cmp, comm, wc, file, strings, od<\/td><td>Inspect, search, and compare data<\/td><\/tr><tr><td>Disk and archives<\/td><td>df, du, gzip, gunzip, tar, dd<\/td><td>Capacity checks, compression, archiving<\/td><\/tr><tr><td>Execution control<\/td><td>jobs, ps, kill, nice, at, crontab, fg, bg, alias, limit<\/td><td>Foreground\/background jobs and scheduling<\/td><\/tr><tr><td>Networking<\/td><td>ssh, scp, sftp, host, lynx, telnet, ftp<\/td><td>Remote access and transfers<\/td><\/tr><tr><td>Text and data processing<\/td><td>sed, awk, perl, sort, tr, cut, paste, fmt, fold<\/td><td>Stream editing and structured text handling<\/td><\/tr><tr><td>Editors and build tools<\/td><td>vi, emacs, xemacs, pico, gcc, g++, make, dbx, cflow<\/td><td>Editing, compiling, and builds<\/td><\/tr><tr><td>Printing and document tooling<\/td><td>lpr, lpq, lprm, enscript, tex, latex, dvips, xdvi<\/td><td>Print queues and document workflows<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For password changes with <code>passwd<\/code>, follow strong password guidance (original external reference): <a href=\"http:\/\/pangea.stanford.edu\/computing\/resources\/network\/security\/safeguards\/strongpass.php\">strong password practices<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">C-shell control keys, symbols, and job control<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">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: <a href=\"http:\/\/pangea.stanford.edu\/computing\/unix\/shell\/specialchars.php\">special characters to avoid in filenames<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Terminal control characters (C-shell)<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Key<\/th><th>Effect<\/th><\/tr><\/thead><tbody><tr><td>Ctrl+H (or Backspace)<\/td><td>Erase previous character<\/td><\/tr><tr><td>Ctrl+U<\/td><td>Erase current input line<\/td><\/tr><tr><td>Ctrl+D<\/td><td>End input for terminal-reading programs<\/td><\/tr><tr><td>Ctrl+S<\/td><td>Pause terminal output<\/td><\/tr><tr><td>Ctrl+Q<\/td><td>Resume terminal output<\/td><\/tr><tr><td>Ctrl+Z<\/td><td>Suspend current foreground job<\/td><\/tr><tr><td>Ctrl+C<\/td><td>Interrupt current foreground program<\/td><\/tr><tr><td>Ctrl+&#92;<\/td><td>Forceful quit of current foreground program<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Special symbols and I\/O operators<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Symbol or command<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td>*<\/td><td>Wildcard for filename matching<\/td><\/tr><tr><td>~user<\/td><td>User home-directory shorthand<\/td><\/tr><tr><td>$name<\/td><td>Variable substitution<\/td><\/tr><tr><td>&#92;<\/td><td>Escape next special character<\/td><\/tr><tr><td>&#8216;&#8230;&#8217;<\/td><td>Single-quote literal string<\/td><\/tr><tr><td>&#8220;&#8230;&#8221;<\/td><td>Double-quote string with variable expansion<\/td><\/tr><tr><td>`&#8230;`<\/td><td>Command substitution (legacy syntax)<\/td><\/tr><tr><td>|<\/td><td>Pipe stdout to next command<\/td><\/tr><tr><td>&gt;<\/td><td>Redirect stdout to file<\/td><\/tr><tr><td>&lt;<\/td><td>Read stdin from file<\/td><\/tr><tr><td>&gt;&gt;<\/td><td>Append stdout to file<\/td><\/tr><tr><td>jobs, fg, bg, kill<\/td><td>Job listing, resume, background, terminate<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml language-bash\">sleep 300 &amp;\njobs\nfg %1\ngrep 'ERROR' app.log | tee errors.log\nsort app.log &gt; sorted.log\nwc -l <span class=\"hljs-tag\">&lt; <span class=\"hljs-attr\">sorted.log<\/span>\n<span class=\"hljs-attr\">.<\/span>\/<span class=\"hljs-attr\">rotate-logs.sh<\/span> &gt;<\/span>&gt; ops.log 2&gt;&amp;1<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">File, directory, and disk operations<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Command<\/th><th>Primary use<\/th><th>Example<\/th><\/tr><\/thead><tbody><tr><td>ls<\/td><td>List files and metadata<\/td><td>ls -al<\/td><\/tr><tr><td>cp<\/td><td>Copy files<\/td><td>cp source.txt backup.txt<\/td><\/tr><tr><td>mv<\/td><td>Move or rename<\/td><td>mv old.log archive.log<\/td><\/tr><tr><td>rm<\/td><td>Delete files<\/td><td>rm -i old.log<\/td><\/tr><tr><td>ln<\/td><td>Create additional link name<\/td><td>ln app.log latest.log<\/td><\/tr><tr><td>chmod<\/td><td>Change permissions<\/td><td>chmod 640 secrets.txt<\/td><\/tr><tr><td>find<\/td><td>Search by criteria<\/td><td>find . -name &#8216;*.conf&#8217; -type f<\/td><\/tr><tr><td>df \/ du<\/td><td>Filesystem free space and usage<\/td><td>df -h ; du -sh .\/data<\/td><\/tr><tr><td>gzip \/ gunzip<\/td><td>Compress and decompress<\/td><td>gzip logs.txt<\/td><\/tr><tr><td>tar<\/td><td>Archive directories\/files<\/td><td>tar -czf release.tgz .\/release<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript language-bash\">pwd\nls -al\nmkdir -p archive\/<span class=\"hljs-number\">2026<\/span>\ncp app.log archive\/<span class=\"hljs-number\">2026<\/span>\/\nmv archive\/<span class=\"hljs-number\">2026<\/span>\/app.log archive\/<span class=\"hljs-number\">2026<\/span>\/app.log<span class=\"hljs-number\">.1<\/span>\nfind archive -name <span class=\"hljs-string\">'*.log*'<\/span> -type f\ndu -sh archive\ndf -h<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Display, compare, and inspect file contents<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Command<\/th><th>Best for<\/th><th>Notes<\/th><\/tr><\/thead><tbody><tr><td>cat<\/td><td>Quick file output<\/td><td>Good for short files and pipelines<\/td><\/tr><tr><td>more<\/td><td>Paged terminal viewing<\/td><td>Useful on long text output<\/td><\/tr><tr><td>head \/ tail<\/td><td>Start or end of files<\/td><td>Common for log triage<\/td><\/tr><tr><td>grep<\/td><td>Pattern matching<\/td><td>Filter lines by regex\/text<\/td><\/tr><tr><td>diff<\/td><td>Line-level text differences<\/td><td>Useful for config comparisons<\/td><\/tr><tr><td>cmp<\/td><td>Binary-level comparison<\/td><td>Reports whether files differ<\/td><\/tr><tr><td>comm<\/td><td>Common\/unique lines<\/td><td>Compares sorted text files<\/td><\/tr><tr><td>wc<\/td><td>Counts lines\/words\/chars<\/td><td>Quick volume checks<\/td><\/tr><tr><td>file<\/td><td>Guess file type<\/td><td>Helpful before parsing unknown files<\/td><\/tr><tr><td>strings \/ od<\/td><td>Inspect binary content<\/td><td>Extract printable text or octal\/hex views<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript language-bash\">head -n <span class=\"hljs-number\">20<\/span> \/<span class=\"hljs-keyword\">var<\/span>\/log\/syslog\ntail -n <span class=\"hljs-number\">50<\/span> \/<span class=\"hljs-keyword\">var<\/span>\/log\/syslog\ngrep -n <span class=\"hljs-string\">'ERROR'<\/span> app.log\ndiff -u old.conf <span class=\"hljs-keyword\">new<\/span>.conf\nwc -l app.log\nfile \/bin\/ls\nstrings \/bin\/ls | head<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Networking and remote transfer commands<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Command<\/th><th>Security profile<\/th><th>Typical use<\/th><\/tr><\/thead><tbody><tr><td>ssh<\/td><td>Encrypted<\/td><td>Remote shell and command execution<\/td><\/tr><tr><td>scp<\/td><td>Encrypted<\/td><td>Non-interactive file copy<\/td><\/tr><tr><td>sftp<\/td><td>Encrypted<\/td><td>Interactive file transfer session<\/td><\/tr><tr><td>telnet<\/td><td>Plaintext credentials<\/td><td>Legacy remote login; generally not recommended<\/td><\/tr><tr><td>ftp<\/td><td>Plaintext credentials<\/td><td>Legacy transfer method; generally not recommended<\/td><\/tr><tr><td>host<\/td><td>N\/A<\/td><td>DNS lookup for host\/IP mapping<\/td><\/tr><tr><td>lynx<\/td><td>N\/A<\/td><td>Text-mode web browsing<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css language-bash\"><span class=\"hljs-selector-tag\">ssh<\/span> <span class=\"hljs-selector-tag\">devops<\/span><span class=\"hljs-keyword\">@example-host<\/span>\nscp release.tgz devops@<span class=\"hljs-attribute\">example-host:<\/span>\/tmp\/\nsftp devops@example-host\nhost example.com<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Text processing, editors, and programming tools<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Area<\/th><th>Commands<\/th><th>Use case<\/th><\/tr><\/thead><tbody><tr><td>Stream editing<\/td><td>sed<\/td><td>Batch substitutions and line transforms<\/td><\/tr><tr><td>Pattern processing<\/td><td>awk<\/td><td>Column-aware text processing<\/td><\/tr><tr><td>General scripting<\/td><td>perl<\/td><td>Powerful text and report extraction<\/td><\/tr><tr><td>Column utilities<\/td><td>cut, paste, tr, sort<\/td><td>Reshape delimiter-based data<\/td><\/tr><tr><td>Editors<\/td><td>vi, emacs, xemacs, pico<\/td><td>Interactive file editing in terminal\/X<\/td><\/tr><tr><td>Compilers and builds<\/td><td>gcc, g++, make, dbx, cflow<\/td><td>Compile, debug, and rebuild source code<\/td><\/tr><tr><td>Shell interpreters<\/td><td>sh, csh, ksh<\/td><td>Run shell scripts in matching shell syntax<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript language-bash\">cut -d<span class=\"hljs-string\">','<\/span> -f1 users.csv | sort\nawk <span class=\"hljs-string\">'{print $1, $3}'<\/span> metrics.txt\nsed <span class=\"hljs-string\">'s\/ERROR\/WARN\/g'<\/span> app.log &gt; app.log.rewritten\ngcc -o hello hello.c\nmake<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Legacy and environment-specific utilities from the original list<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Kerberos commands: <code>kinit<\/code>, <code>kdestroy<\/code><\/li><li>Email and bulletin tools: <code>mailx<\/code>, <code>msgs<\/code>, <code>uuencode<\/code>, <code>uudecode<\/code>, <code>rn<\/code><\/li><li>X Window clients: <code>xterm<\/code>, <code>xauth<\/code>, <code>xload<\/code>, <code>xman<\/code>, <code>xdvi<\/code>, <code>gv<\/code><\/li><li>TeX toolchain: <code>tex<\/code>, <code>latex<\/code>, <code>dvips<\/code>, <code>latex2html<\/code><\/li><li>Tape\/archive operations: <code>mt<\/code>, <code>dd<\/code>, <code>tar<\/code>, <code>ltf<\/code><\/li><li>Scientific\/programming libraries and tools listed: <code>lapack<\/code>, <code>dbm<\/code>, <code>xdr<\/code>, <code>netcdf<\/code>, <code>f77<\/code>, <code>f2c<\/code><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Best practices and common pitfalls<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Use <code>man<\/code> (and <code>man -k<\/code>) before running unfamiliar commands on production paths.<\/li><li>Prefer <code>ssh<\/code>, <code>scp<\/code>, and <code>sftp<\/code> over plaintext protocols like <code>telnet<\/code> and <code>ftp<\/code>.<\/li><li>Be careful with destructive commands (<code>rm<\/code>, <code>mv<\/code>, <code>dd<\/code>); test on sample data first.<\/li><li>Verify which shell you are in; C-shell behavior can differ significantly from Bash\/Zsh.<\/li><li>Use redirection and logging deliberately so command output is auditable (<code>&gt;&gt;<\/code>, <code>tee<\/code>, <code>2&gt;&amp;1<\/code>).<\/li><li>Expect command availability to vary across UNIX\/Linux environments, especially for legacy tools.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>A structured UNIX command reference organized by real operational tasks: discovery, files, processes, networking, text processing, and job control. Includes C-shell notes, comparison tables, and practical command examples.<\/p>\n","protected":false},"author":1,"featured_media":3896,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4957],"tags":[378,1979,2731,2735,169,2733,2734,2742,2740,2741,2739,2744,2743,2736,2737,2738,2732],"class_list":["post-293","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-commands","tag-common","tag-general","tag-list-of-unix-commands","tag-unix","tag-unix-commands","tag-unix-commands-and-utilities","tag-unix-commands-and-utilities-cheatsheet","tag-unix-commands-and-utilities-guide","tag-unix-commands-and-utilities-references","tag-unix-commands-and-utilities-tutorials","tag-unix-commands-guide","tag-unix-commands-tutorials","tag-useful-unix-commands","tag-useful-unix-commands-cheatsheet","tag-useful-unix-commands-references","tag-utilities"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/293","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=293"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/293\/revisions"}],"predecessor-version":[{"id":79131,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/293\/revisions\/79131"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/3896"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}