Linux commands
Filesystem
Command Definition
ls Lists files and directories in the current or specified directory.
cp Copies files or directories from one location to another.
mv Moves or renames files or directories.
rm Removes (deletes) files or directories.
ln Creates hard or symbolic (soft) links between files.
mkdir Creates a new directory.
rmdir Removes an empty directory.
pwd Prints the current working directory.
touch Creates an empty file or updates an existing file’s modification/access
timestamps.
dd Copies and converts raw data from one file or device to another, often used
for disk imaging.
df Displays disk space usage for file systems.
du Displays disk space usage for files and directories.
Text Processing
Command Definition
cat Concatenates and displays file content.
echo Prints text or variable values to standard output.
grep Searches text using patterns (regular expressions).
sed Stream editor for text transformations and substitutions.
awk Pattern scanning and processing language for text data.
cut Extracts specific columns or fields from lines of text.
paste Merges lines of files horizontally.
sort Sorts lines of text.
uniq Removes or shows duplicate lines (requires sorted input).
tr Translates, deletes, or squeezes characters.
head Displays the first N lines of a file (default 10).
tail Displays the last N lines of a file (default 10).
wc Counts lines, words, and characters in a file.
diff Compares two files line by line.
fold Wraps text to a specified width.
join Joins lines from two files on a common field.
xargs Builds and executes commands from standard input.
tee Reads from standard input and writes to both standard output and files.
fmt Simple text formatter for paragraph wrapping.
pr Formats text for printing (adds headers, columns).
nl Numbers the lines of a file.
comm Compares two sorted files line by line.
csplit Splits a file into sections based on patterns or line numbers.
Shell & Utilities
Command Definition
alias Creates a shortcut or alternative name for a command.
command Runs a command, ignoring shell functions/aliases of the same name.
test Evaluates conditional expressions (files, strings, numbers).
type Shows how a command name would be interpreted (builtin, alias, file path).
env Displays or modifies the environment variables.
exit Exits the current shell.
false Returns an unsuccessful (non-zero) exit status.
true Returns a successful (zero) exit status.
printf Prints formatted output (like C’s printf).
umask Sets default permission bits for newly created files.
unalias Removes defined aliases.
wait Waits for background processes to finish.
Process & Jobs
Command Definition
ps Displays currently running processes.
kill Sends a signal (often terminate) to a process.
nice Starts a process with adjusted scheduling priority.
renice Changes the priority of a running process.
sleep Delays execution for a given time.
time Measures how long a command takes to run.
at Schedules a one-time task to run at a specific time.
batch Runs commands when system load is low.
cron Time-based job scheduler (daemon and configuration).
fg Brings a background job to the foreground.
bg Resumes a suspended job in the background.
nohup Runs a command immune to hangups (continues after logout).
Administration
Command Definition
man Displays manual pages for commands.
chmod Changes file or directory permissions.
chown Changes file or directory ownership.
chgrp Changes a file or directory’s group ownership.
passwd Changes a user’s password.
umask (duplicate from Shell & Utilities — see above)
Miscellaneous
Command Definition
ar Creates, modifies, and extracts from archive files (used for static
libraries).
basename Strips directory path, leaving only filename.
dirname Strips filename, leaving only directory path.
cal Displays a calendar.
bc Command-line calculator with arbitrary precision.
expr Evaluates expressions (arithmetic, string, regex).
date Displays or sets the system date/time.
locale Displays or sets system locale settings.
od Displays file contents in octal/hexadecimal and ASCII.
pax Portable archive exchange utility (tar/cpio-compatible).
strings Prints printable text from binary files.
tty Prints the terminal device name.
uname Displays system information (kernel, OS, architecture).
who Shows who is currently logged in.
write Sends a message to another logged-in user.
yacc Generates parsers from grammar descriptions.