100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

DevOps Reference

Linux Commands Reference

Linux commands are small programs you combine: one to list or find files (ls, find), one to read or filter text (cat, grep, awk), one to change permissions (chmod, chown), one to inspect processes (ps, top, kill) and one to move data over the network (curl, ssh, scp). This reference lists each with a working example.

125 entries9 categoriesFree, no sign-up

Browse by Category

All Linux Commands (125)

Files & Directories (16)

Creating, moving, copying and removing things on disk.

ls

Does

List directory

Description

Lists directory contents. -l gives the long form with permissions and size, -a includes dotfiles, -h makes sizes human-readable.

Example

ls -lah

cd

Does

Change directory

Description

Moves the shell to another directory. With no argument it returns home; with - it returns to the previous directory.

Example

cd /var/log

pwd

Does

Print working dir

Description

Prints the absolute path of the directory you are currently in.

Example

pwd

mkdir

Does

Create directory

Description

Creates a directory. -p creates missing parents and does not complain if it already exists.

Example

mkdir -p src/app/utils

rmdir

Does

Remove empty dir

Description

Deletes a directory only if it is empty — safer than rm -r when that is what you mean.

Example

rmdir build

rm

Does

Delete files

Description

Removes files. -r recurses into directories and -f suppresses prompts. There is no undo and no trash.

Example

rm -rf node_modules

cp

Does

Copy

Description

Copies files or directories. -r is required for directories, -a preserves permissions and timestamps.

Example

cp -r src/ backup/

mv

Does

Move or rename

Description

Moves a file to another path, which is also how renaming is done.

Example

mv draft.md final.md

touch

Does

Create or timestamp

Description

Creates an empty file, or updates the modification time of one that exists.

Example

touch .env.local

ln -s

Does

Symbolic link

Description

Creates a symlink pointing at another path. Without -s it makes a hard link to the same inode.

Example

ln -s /opt/app/current /usr/local/app

stat

Does

File metadata

Description

Shows size, permissions, inode, and access, modification and change timestamps.

Example

stat app.log

file

Does

Identify a file

Description

Reports what a file actually is by inspecting its contents rather than trusting the extension.

Example

file image.dat

basename

Does

Strip the path

Description

Prints the final component of a path, optionally with a suffix removed.

Example

basename /var/log/app.log .log

dirname

Does

Strip the filename

Description

Prints everything but the last component of a path.

Example

dirname /var/log/app.log

realpath

Does

Resolve a path

Description

Prints the canonical absolute path with all symlinks and .. segments resolved.

Example

realpath ./bin/../app

tree

Does

Directory tree

Description

Draws the directory hierarchy as a tree. -L limits the depth.

Example

tree -L 2 src

Viewing & Editing (12)

Reading file contents and editing them in place.

cat

Does

Print a file

Description

Writes a file to standard output. Concatenates when given several, which is where the name comes from.

Example

cat /etc/hostname

less

Does

Page through

Description

Views a file one screen at a time with search and scrolling, without loading it all into memory.

Example

less /var/log/syslog

head

Does

First lines

Description

Prints the first 10 lines of a file, or -n of your choosing.

Example

head -n 20 access.log

tail

Does

Last lines

Description

Prints the last lines of a file — the fastest way to see the most recent entries in a log.

Example

tail -n 50 error.log

tail -f

Does

Follow a log

Description

Keeps the file open and prints new lines as they are written. -F also survives log rotation.

Example

tail -F /var/log/nginx/access.log

nano

Does

Simple editor

Description

A terminal editor with on-screen key hints — the one to reach for when you just need to change a config line.

Example

nano /etc/hosts

vim

Does

Modal editor

Description

A powerful modal editor present on essentially every Unix system. Press Esc then :wq to save and quit.

Example

vim config.yml

wc

Does

Count

Description

Counts lines, words and bytes. -l for lines is the common use, usually at the end of a pipe.

Example

wc -l access.log

nl

Does

Number lines

Description

Prints a file with line numbers prepended.

Example

nl script.sh

diff

Does

Compare files

Description

Shows the lines that differ between two files. -u gives the unified format used by patches.

Example

diff -u old.conf new.conf

tee

Does

Split output

Description

Writes its input to a file and to standard output at once, so a pipeline can be saved and watched.

Example

make 2>&1 | tee build.log

xxd

Does

Hex dump

Description

Shows a file as hexadecimal with an ASCII column, for inspecting binaries.

Example

xxd -l 64 image.png

Permissions & Ownership (10)

Who may read, write or execute what.

chmod

Does

Change permissions

Description

Sets read, write and execute bits, either as octal digits or as symbolic changes such as u+x.

Example

chmod 755 deploy.sh

chmod +x

Does

Make executable

Description

Adds the execute bit so a script can be run directly rather than passed to an interpreter.

Example

chmod +x scripts/build.sh

chmod -R

Does

Recursive permissions

Description

Applies a mode to a directory and everything under it. Use capital X to set execute on directories only.

Example

chmod -R u+rwX,go+rX public/

chown

Does

Change owner

Description

Reassigns the owning user and optionally the group of a file. Requires root.

Example

chown -R www-data:www-data /var/www

chgrp

Does

Change group

Description

Changes only the group that owns a file.

Example

chgrp developers shared/

umask

Does

Default permissions

Description

Shows or sets the bits masked off new files, which is what determines their default mode.

Example

umask 022

sudo

Does

Run as another user

Description

Runs one command as root, or as the user given by -u, subject to policy in /etc/sudoers and logged.

Example

sudo systemctl restart nginx

su

Does

Switch user

Description

Starts a shell as another user, requiring that account's password.

Example

su - deploy

getfacl

Does

Read ACLs

Description

Shows access control lists, the finer-grained permissions that sit alongside the classic owner-group-other bits.

Example

getfacl /srv/data

setfacl

Does

Set ACLs

Description

Grants a specific user or group rights to a file without changing its owner or group.

Example

setfacl -m u:alice:rwx report.csv

Processes & Jobs (16)

Starting, watching and stopping running programs.

ps aux

Does

List processes

Description

Prints a snapshot of every running process with its user, PID, CPU and memory use.

Example

ps aux | grep node

top

Does

Live process view

Description

Updates continuously, sorted by CPU use, so you can watch load as it happens.

Example

top

htop

Does

Friendlier top

Description

An interactive process viewer with colour, scrolling and per-core meters. Usually needs installing.

Example

htop

kill

Does

Signal a process

Description

Sends a signal to a PID. The default TERM asks it to shut down cleanly.

Example

kill 4821

kill -9

Does

Force kill

Description

Sends SIGKILL, which the process cannot catch or ignore. Skips cleanup, so try TERM first.

Example

kill -9 4821

pkill

Does

Kill by name

Description

Signals every process whose name matches a pattern, without needing to look up PIDs.

Example

pkill -f "node server.js"

pgrep

Does

Find PIDs by name

Description

Prints the PIDs of processes matching a pattern — the safe look before a pkill.

Example

pgrep -a nginx

jobs

Does

Shell jobs

Description

Lists background and stopped jobs belonging to the current shell.

Example

jobs -l

bg / fg

Does

Background/foreground

Description

Resumes a stopped job in the background, or brings a background job to the foreground.

Example

fg %1

nohup

Does

Survive logout

Description

Runs a command immune to hangup, so it keeps going after the terminal closes.

Example

nohup ./worker.sh &

nice / renice

Does

Set priority

Description

Starts a process at a lower CPU priority, or changes the priority of one already running.

Example

nice -n 10 ./batch.sh

systemctl

Does

Manage services

Description

Starts, stops, enables and inspects systemd units — the standard service manager on modern distributions.

Example

systemctl status nginx

journalctl

Does

Read system logs

Description

Queries the systemd journal. -u filters to one unit, -f follows, --since takes a time window.

Example

journalctl -u nginx -f

crontab -e

Does

Schedule jobs

Description

Edits the current user's scheduled tasks, one per line with a five-field time specification.

Example

crontab -e

watch

Does

Repeat a command

Description

Re-runs a command at a fixed interval and redraws the screen, for watching something change.

Example

watch -n 2 df -h

timeout

Does

Cap a runtime

Description

Runs a command and kills it if it exceeds a time limit.

Example

timeout 30s ./healthcheck.sh

System & Monitoring (14)

Disk, memory, uptime and hardware information.

df -h

Does

Disk free

Description

Shows how full each mounted filesystem is, in human-readable units.

Example

df -h

du -sh

Does

Directory size

Description

Totals the space a directory occupies. -s summarises rather than listing every file.

Example

du -sh /var/log/*

free -h

Does

Memory use

Description

Reports used, free and cached memory. On Linux, cache counts as available — look at the available column.

Example

free -h

uptime

Does

Load and uptime

Description

Shows how long the machine has been running and the load average over 1, 5 and 15 minutes.

Example

uptime

uname -a

Does

Kernel info

Description

Prints kernel name, version and machine architecture.

Example

uname -a

lsb_release -a

Does

Distribution info

Description

Reports the distribution and release. /etc/os-release is the more portable source.

Example

lsb_release -a

lsblk

Does

List block devices

Description

Shows disks and partitions as a tree with sizes and mount points.

Example

lsblk -f

mount

Does

Attach a filesystem

Description

Makes a device available at a directory. With no arguments it lists what is currently mounted.

Example

mount /dev/sdb1 /mnt/data

lsof

Does

List open files

Description

Shows which processes have which files open — including sockets, which is how you find what holds a port.

Example

sudo lsof -i :3000

dmesg

Does

Kernel messages

Description

Prints the kernel ring buffer, where hardware and driver problems surface first.

Example

dmesg -T | tail -30

iostat

Does

Disk throughput

Description

Reports CPU and per-device I/O statistics, for telling a disk-bound system from a CPU-bound one.

Example

iostat -xz 2

vmstat

Does

Virtual memory stats

Description

Samples processes, memory, swap and I/O at an interval — a fast first look at where a system is stuck.

Example

vmstat 2 5

date

Does

Show or set time

Description

Prints the current date and time, with a format string for scripting.

Example

date +%Y-%m-%d

ncdu

Does

Interactive disk usage

Description

Browsable disk usage analyser — the fastest way to find what filled a disk. Usually needs installing.

Example

ncdu /var

Networking (18)

Connections, transfers and name resolution.

curl

Does

HTTP client

Description

Makes requests to URLs. -I fetches headers only, -o writes to a file, -X sets the method.

Example

curl -I https://example.com

wget

Does

Download files

Description

Downloads over HTTP or FTP, resuming and recursing where curl would not.

Example

wget -c https://example.com/big.iso

ping

Does

Test reachability

Description

Sends ICMP echoes to a host and reports round-trip time and loss.

Example

ping -c 4 example.com

ip a

Does

Show interfaces

Description

Lists network interfaces and their addresses. Replaces the older ifconfig.

Example

ip a

ip r

Does

Show routes

Description

Prints the routing table, including which interface carries the default route.

Example

ip r

ss -ltnp

Does

Listening sockets

Description

Lists listening TCP sockets with the owning process. The modern replacement for netstat.

Example

sudo ss -ltnp

netstat -tulpn

Does

Sockets (legacy)

Description

The older way to list listening sockets and their processes, still common in documentation.

Example

sudo netstat -tulpn

dig

Does

DNS lookup

Description

Queries DNS and prints the full answer. +short reduces it to just the values.

Example

dig +short example.com A

nslookup

Does

DNS lookup (simple)

Description

A simpler interactive DNS query tool, widely available including on Windows.

Example

nslookup example.com

host

Does

DNS one-liner

Description

Resolves a name to addresses in a single compact line.

Example

host example.com

traceroute

Does

Trace the path

Description

Shows each hop between you and a host, exposing where latency or loss begins.

Example

traceroute example.com

ssh

Does

Remote shell

Description

Opens an encrypted shell on another machine. -i selects a key, -p a non-default port.

Example

ssh -i ~/.ssh/id_ed25519 user@host

ssh -L

Does

Port forward

Description

Tunnels a local port to a remote one over SSH — the safe way to reach a database bound to localhost.

Example

ssh -L 5432:localhost:5432 user@host

scp

Does

Copy over SSH

Description

Copies files between machines over SSH. -r for directories.

Example

scp -r ./dist user@host:/var/www

rsync

Does

Sync directories

Description

Copies only what differs, resumes, and can delete extras. -avz is the usual archive-verbose-compress trio.

Example

rsync -avz --delete ./dist/ user@host:/var/www/

nc

Does

Raw sockets

Description

Reads and writes TCP or UDP connections directly. -zv tests whether a port is open.

Example

nc -zv example.com 443

ufw

Does

Firewall

Description

A simplified front end to the kernel firewall, for allowing and denying ports.

Example

sudo ufw allow 443/tcp

openssl s_client

Does

Inspect TLS

Description

Opens a TLS connection and prints the certificate chain and negotiated cipher.

Example

openssl s_client -connect example.com:443

Archives & Packages (10)

Compressing, extracting and installing software.

tar -czf

Does

Create an archive

Description

Bundles files into a gzip-compressed tarball. c creates, z compresses, f names the file.

Example

tar -czf site.tar.gz public/

tar -xzf

Does

Extract an archive

Description

Unpacks a gzip tarball into the current directory. -C extracts somewhere else.

Example

tar -xzf site.tar.gz -C /var/www

tar -tzf

Does

List archive contents

Description

Shows what is inside an archive without extracting it — worth doing before unpacking anything.

Example

tar -tzf site.tar.gz

zip / unzip

Does

Zip archives

Description

Creates and extracts zip files, the format to use when the other end is not Unix.

Example

zip -r site.zip public/

gzip / gunzip

Does

Compress one file

Description

Compresses a single file in place, replacing it with a .gz version.

Example

gzip access.log

apt install

Does

Install (Debian)

Description

Installs packages on Debian and Ubuntu. Run apt update first so the index is current.

Example

sudo apt update && sudo apt install nginx

apt search

Does

Find a package

Description

Searches package names and descriptions in the configured repositories.

Example

apt search postgresql

dnf install

Does

Install (Fedora/RHEL)

Description

Installs packages on Fedora, RHEL and derivatives. Replaced yum, which still works as an alias.

Example

sudo dnf install nginx

pacman -S

Does

Install (Arch)

Description

Installs packages on Arch and derivatives.

Example

sudo pacman -S nginx

dpkg -l

Does

List installed

Description

Lists installed Debian packages and their versions.

Example

dpkg -l | grep nginx

Shell & Users (14)

Accounts, environment and shell built-ins.

echo

Does

Print text

Description

Writes its arguments to standard output, the workhorse of shell scripting.

Example

echo "$HOME"

export

Does

Set an env var

Description

Defines a variable and makes it visible to programs the shell starts.

Example

export NODE_ENV=production

env

Does

Show environment

Description

Prints every exported variable, or runs a command with a modified environment.

Example

env | sort

alias

Does

Shorthand command

Description

Defines a shorter name for a longer command. Put it in your shell rc file to make it permanent.

Example

alias ll='ls -lah'

history

Does

Past commands

Description

Lists commands you have run. Pipe through grep to find one you half remember.

Example

history | grep docker

source

Does

Run in this shell

Description

Executes a script in the current shell so its variables and functions persist afterwards.

Example

source ~/.bashrc

whoami

Does

Current user

Description

Prints the username the shell is running as — worth checking after a sudo or su.

Example

whoami

id

Does

User and groups

Description

Shows the numeric user ID, group ID and every group the user belongs to.

Example

id deploy

useradd

Does

Create a user

Description

Adds an account. -m creates the home directory, -s sets the login shell.

Example

sudo useradd -m -s /bin/bash deploy

usermod -aG

Does

Add to a group

Description

Appends a user to a supplementary group. Omitting -a replaces their groups instead of adding.

Example

sudo usermod -aG docker deploy

passwd

Does

Change password

Description

Sets a password for your account, or for another when run as root.

Example

sudo passwd deploy

man

Does

Read the manual

Description

Opens a command's manual page — the authoritative reference for flags this table only samples.

Example

man tar

chsh

Does

Change shell

Description

Sets the login shell for an account.

Example

chsh -s /bin/zsh

clear

Does

Clear the screen

Description

Blanks the terminal. Ctrl+L usually does the same thing without typing.

Example

clear

Frequently Asked Questions

What does chmod 755 mean?

Each digit is a permission set in octal for owner, group and everyone else. 7 is read+write+execute (4+2+1), 5 is read+execute (4+1). So 755 means the owner can read, write and run the file while everyone else can read and run it — the usual mode for a script or a directory.

What is the difference between grep, sed and awk?

grep selects lines that match a pattern. sed edits a stream, most often substituting text line by line. awk splits each line into fields and lets you compute over them, so it handles columns and arithmetic that grep and sed cannot.

How do I find which process is using a port?

Run sudo lsof -i :8080 or sudo ss -ltnp | grep 8080. Both print the PID of the listening process, which you can then stop with kill. ss is the modern replacement for netstat and is installed by default on most current distributions.

What is the difference between sudo and su?

sudo runs a single command as another user (root by default) after checking a policy file, and logs it. su opens a whole shell as that user and needs the target account's password. sudo is preferred because it is scoped to one command and leaves an audit trail.

Related Reading

#Linux#Bash#CommandLine#Shell#SystemAdministration#DevOps#Infrastructure#QuickReference#DeveloperReference#KnowledgeHub#SkillVeris#LinuxCommands#UnixCommands#BashCommands#TerminalCommands#ChmodPermissions

Frequently Asked Questions

21 categories · pick one to explore

What is SkillVeris?
SkillVeris is a completely free tech-upskilling platform offering 37 live courses across AI/ML, programming, web development, DevOps, cloud, security and databases. It combines structured courses of 24–40 lessons, a 24/7 AI Mentor, and a unique Learn Through Hobbies method that explains technical concepts through cricket, music, gaming, cooking and more. It is powered by Sri Hayavadhana.
Is SkillVeris really a free learning platform?
Yes, SkillVeris is genuinely free. Every course, assessment, certificate, study note, cheat sheet and the AI Mentor are available at no cost. There are no hidden paywalls, trial periods or premium tiers locking away lessons. The platform was built to make quality tech education accessible to learners in India and worldwide without financial barriers.
Who is SkillVeris for?
SkillVeris is for anyone learning technology skills: complete beginners starting to code, students preparing for placements, working professionals switching into AI, DevOps or cloud roles, and hobbyists exploring new tools. Courses span beginner to advanced levels, and the Learn Through Hobbies method makes complex topics approachable even if you have no technical background at all.
What makes SkillVeris different from other online learning platforms?
SkillVeris stands out with its Learn Through Hobbies method, which teaches every concept through analogies from cricket, music, gaming, cooking and eight more domains you can switch instantly. Add a free 24/7 AI Mentor, structured courses of 24–40 lessons with certificates, Code Lab for in-browser practice, and a live jobs portal, all completely free of charge.
What can I learn on SkillVeris?
You can learn AI and machine learning, Python, programming fundamentals, web development, DevOps, cloud computing, security and databases through 37 live courses. Beyond courses, SkillVeris offers study notes, cheat sheets, a glossary of roughly 2,000+ terms, 500+ blog articles, interview questions with readiness scoring, and Code Lab supporting six programming languages.
Does SkillVeris offer personalized learning?
Yes, personalization is central to SkillVeris. You choose the analogy domain that matches your interests, cricket, gaming, music, cooking and more, and lessons instantly adapt their explanations. The AI Mentor answers your questions at Quick, Detailed or Deep-dive depth, and learning paths guide you toward specific careers like AI Engineer or DevOps Engineer.
Do I need any prior experience to start learning on SkillVeris?
No prior experience is needed. Many SkillVeris courses are designed for absolute beginners, starting from fundamentals and building up gradually across 35 structured lessons. The Learn Through Hobbies analogies explain technical ideas using everyday interests, so newcomers grasp concepts faster. Intermediate and advanced courses are also available when you are ready to progress.
How do I get started with SkillVeris?
Simply visit skillveris.com, create a free account, and pick a course from the Topics page or follow a learning path like AI Engineer or Full Stack Java Developer. Choose your favourite analogy domain, work through the lessons, pass the module assessments and final exam, and earn your certificate, all without paying anything.
Is SkillVeris available in India?
Yes, SkillVeris is fully available in India and is built with Indian learners strongly in mind. All 37 courses, certificates and tools are free, and the jobs portal aggregates live roles across India alongside the UK, USA, Germany and remote positions, with salary and experience filters to help you find relevant opportunities.
Can I use SkillVeris on my mobile phone?
Yes, SkillVeris works in any modern mobile browser, so you can read lessons, switch analogy domains, ask the AI Mentor questions and take assessments from your phone. The platform is designed to load fast on mobile connections, making it practical to learn during commutes or short breaks without needing a laptop.
What is the Learn Through Hobbies method on SkillVeris?
Learn Through Hobbies is SkillVeris's signature teaching approach: every key concept is explained through analogies drawn from twelve domains including cricket, music, gaming, cooking, fitness, travel and finance. You pick the domain you love and can switch instantly, so abstract topics like machine learning pipelines feel familiar rather than intimidating.
Does SkillVeris have an AI tutor?
Yes, SkillVeris includes a built-in AI Mentor available 24/7. You can ask it any question about your lessons or technology in general and choose the depth of the answer: Quick for a fast summary, Detailed for a fuller explanation, or Deep-dive for a thorough walkthrough. It is free for every learner.
Does SkillVeris help with job hunting?
Yes, SkillVeris has a jobs portal aggregating live roles across India, the UK, USA, Germany and remote positions, with salary and experience filters. Combined with interview questions featuring readiness scoring, career-focused learning paths and free certificates you can share, the platform supports your job search from skill-building through to applications.
What learning paths does SkillVeris offer?
SkillVeris offers career-oriented learning paths such as AI Engineer, DevOps Engineer and Full Stack Java Developer, among others. Each path sequences relevant courses in a logical order so you build skills progressively toward a specific role, rather than guessing which course to take next. All path courses are free and include certificates.
How much time do I need to complete a SkillVeris course?
It depends on your pace. Structured courses contain 24–40 lessons (most have 35) plus module assessments and a final exam, and each lesson typically takes around half an hour of focused reading and practice. Many learners finish a course in a few weeks studying part-time, while dedicated full-time learners can move considerably faster.
Can I practice coding on SkillVeris?
Yes, SkillVeris includes Code Lab, an in-browser coding environment supporting six programming languages across 15 practice categories. You can write and run code directly in your browser without installing anything, which makes it easy to reinforce what you learn in lessons immediately. Code Lab is free, like everything else on the platform.
Does SkillVeris have free study materials besides courses?
Yes, alongside courses SkillVeris offers free study notes, cheat sheets for quick revision, a glossary of roughly 2,000+ technical terms, more than 500 blog articles, and interview questions with readiness scoring. These resources complement the courses and are handy for exam preparation, interviews and quick refreshers, all at no cost.
Who powers SkillVeris?
SkillVeris is powered by Sri Hayavadhana. The platform's mission is to make high-quality technology education free and genuinely engaging, combining structured courses, an always-available AI Mentor and the Learn Through Hobbies analogy method so learners in India and around the world can upskill without cost being a barrier.
Is SkillVeris suitable for working professionals switching careers?
Yes, career switchers can follow structured learning paths like AI Engineer or DevOps Engineer, study flexibly around work using mobile-friendly lessons, and validate their progress through assessments and certificates. The jobs portal with salary and experience filters, plus interview questions with readiness scoring, helps professionals move into new tech roles confidently.
How is SkillVeris free, is there a catch?
There is no catch. SkillVeris does not charge for courses, certificates, the AI Mentor, Code Lab or any learning resource, and there are no trial expirations or locked premium content. The platform exists to make tech education accessible, particularly for learners in India and other regions where paid platforms are often out of reach.

What Learners Say

Real journeys from the SkillVeris community — swipe for more.

SkillVeris taught me Python through Cricket. Now I’m building real projects and feeling confident!
Arjun S. · B.Tech Student
The best platform for hobby-based learning. Concepts finally stick.
Priya R. · Data Analyst
I went from zero coding to a portfolio of projects — all by learning through my love for gaming. Landed my first internship!
Kabir M. · CS Undergraduate
Trending Topics50 popular tags — tap to explore
Trending CoursesAll 37 free courses — tap to browse