Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

Unix Basics for DevOps Engineers: Commands, Permissions, Pipes, and Workflow

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.

unix-presentation

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

CommandBest forExample
pwd, cd, lsNavigation and directory inspectionls -lah /var/log
cat, less, head, tailReading files and logstail -n 100 app.log
grep, sort, uniq, wcText filtering and aggregationgrep "ERROR" app.log | wc -l
find, xargsFile discovery and bulk operationsfind . -name "*.yaml"
chmod, chownPermissions and ownershipchmod 640 secrets.txt
ps, kill, topProcess visibility and controlps 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

OperatorMeaningExample
>Write stdout to a file (overwrite)command > out.txt
>>Append stdout to a filecommand >> out.txt
2>Write stderr to a filecommand 2> err.txt
2>&1Send stderr to same target as stdoutcommand > all.log 2>&1
|Pipe stdout of one command to next command inputcat app.log | grep ERROR

Best practices and common pitfalls

  • Use pwd and ls often to avoid running commands in the wrong directory.
  • Quote paths with spaces: "my file.txt".
  • Be careful with recursive operations like rm -rf and broad find patterns.
  • Check permissions before assuming a command is broken.
  • Read command help with man pages or --help flags.
  • 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.

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

How to Configure HTTP/HTTPS Proxy on Linux and Windows (CLI, GUI, Registry, and APT)

Set up proxy access correctly on Windows and Linux for command-line tools, package managers, and system-level use. This guide covers quick commands, persistent configuration, and common troubleshooting steps.

Read More

Linux pmap Command Guide: Inspect Process Memory Maps with Practical Examples

Learn how to use the Linux pmap command to inspect per-process memory mappings, compare output modes, and troubleshoot high memory usage quickly. This updated guide includes workflow steps, command examples, and interpretation tips.

Read More

iostat Command Guide for Linux: 20 Practical Examples for CPU and Disk I/O Troubleshooting

Learn how to use iostat to monitor CPU and storage performance on Linux systems. This revised guide covers installation, 20 practical commands, metric interpretation, and a troubleshooting workflow.

Read More

xargs in Linux: Practical Commands, Safe Patterns, and Pipeline Workflows

This guide explains how to use xargs effectively in Linux/Unix shells, from basic stdin handling to safe file operations and parallel execution. You’ll learn practical command patterns, portability caveats, and safer alternatives.

Read More

Linux mount and umount Commands: Practical Examples, /etc/fstab, and Safe Unmounting

Learn how to mount and unmount filesystems reliably on Linux, from one-off commands to persistent /etc/fstab entries. This guide covers common filesystem types, command comparisons, and safe troubleshooting steps.

Read More

How to Use gsh to Run Linux Commands Across Multiple Servers

gsh (Group Shell) lets you execute one command across many Linux hosts from a single terminal. This guide explains host grouping with /etc/ghosts, core options, and practical command patterns.

Read More
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Jason Mitchell
Jason Mitchell
2 months ago

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.

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