Originally published on 2009-03-07; fully revised and updated.
Unix fundamentals are still central to modern DevOps work, from troubleshooting CI runners to managing containers and servers. This guide gives you a clear, practical starting point: what Unix is, how commands run, and which commands you will use daily.

Original presentation and attribution
The original post was primarily an embedded SlideShare presentation. It is preserved below for attribution and historical reference.
Basic Unix from Rajesh Kumar. View more presentations on SlideShare.
Unix fundamentals every DevOps engineer should know
In practice, most engineers work on Unix-like systems (commonly Linux and BSD-derived environments). The command model and tooling patterns below are broadly transferable across shells and distributions.
- Everything is file-oriented: devices, logs, configs, and process interfaces are often exposed through filesystem-like paths.
- Small tools compose well: combine commands with pipes to solve bigger tasks quickly.
- Permissions matter: ownership and mode bits control what users and services can read, write, or execute.
- Processes are first-class: service operation, debugging, and incident response all rely on process inspection.
- Text is the universal interface: logs and config files are frequently plain text and easy to automate.
How a Unix command is executed
Understanding this path helps with debugging command failures, permission errors, and path issues in CI/CD jobs.
flowchart TD
A[User types command in shell] --> B[Shell parses command and expands variables]
B --> C{Built in command}
C -- yes --> D[Shell executes built in]
C -- no --> E[Shell locates executable in PATH]
E --> F[Kernel starts process]
F --> G[Program reads input and files]
G --> H[Program writes stdout or stderr]
D --> I[Shell returns exit code]
H --> I
The shell captures an exit code after each command. A zero value usually means success; non-zero values indicate an error condition.
Essential Unix commands at a glance
| Command | Best for | Example |
|---|---|---|
pwd, cd, ls | Navigation and directory inspection | ls -lah /var/log |
cat, less, head, tail | Reading files and logs | tail -n 100 app.log |
grep, sort, uniq, wc | Text filtering and aggregation | grep "ERROR" app.log | wc -l |
find, xargs | File discovery and bulk operations | find . -name "*.yaml" |
chmod, chown | Permissions and ownership | chmod 640 secrets.txt |
ps, kill, top | Process visibility and control | ps aux | grep nginx |
Practical Unix command examples
Use these examples as a starter lab in a non-production directory.
Navigate files and inspect directories
mkdir -p ~/unix-lab/logs
cd ~/unix-lab
pwd
touch notes.txt
echo "hello unix" > notes.txt
ls -lah
cat notes.txtCode language: PHP (php)
Read, search, and transform text
grep -R "ERROR" /var/log 2>/dev/null | head
find . -type f -name "*.log" -mtime -1
sort app.log | uniq -c | sort -nr | headCode language: JavaScript (javascript)
Permissions and processes
chmod 640 notes.txt
chown $USER:$USER notes.txt
ps aux | grep ssh
kill -TERM 12345Code language: PHP (php)
Redirection and pipeline operators
| Operator | Meaning | Example |
|---|---|---|
> | Write stdout to a file (overwrite) | command > out.txt |
>> | Append stdout to a file | command >> out.txt |
2> | Write stderr to a file | command 2> err.txt |
2>&1 | Send stderr to same target as stdout | command > all.log 2>&1 |
| | Pipe stdout of one command to next command input | cat app.log | grep ERROR |
Best practices and common pitfalls
- Use
pwdandlsoften to avoid running commands in the wrong directory. - Quote paths with spaces:
"my file.txt". - Be careful with recursive operations like
rm -rfand broadfindpatterns. - Check permissions before assuming a command is broken.
- Read command help with
manpages or--helpflags. - In production, prefer non-destructive dry runs when available.
If you are new to Unix, focus first on navigation, text processing, and permissions. Those three areas solve a large share of daily DevOps troubleshooting tasks.
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.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals
One area that becomes important after learning Unix basics is understanding how small system-level decisions affect reliability over time. For example, unmanaged scripts, incorrect permissions, and inconsistent environment settings can create hidden issues that appear only during deployments or incidents. Building good operational habits around documentation, repeatable configurations, and safe change practices helps teams avoid problems that are difficult to diagnose later. Unix skills become much more valuable when they are applied with an engineering mindset focused on stability, automation, and maintainability.