List of Commands
Tricks to learn commands
Articles
Commands for Comparing Files and Directories in Linux
The main commands for comparing files in Linux are diff (which lines differ), cmp (are two files byte for byte the same) and sha256sum (compare checksums). For...
Commands for Handling files and directories
Everyday commands for working with files and folders on Linux:
mkdir dir # create a folder
mkdir -p dir1/dir2 # create nested folders
cd dir...
Commands for changing file access rights
Linux permissions decide who can read (r), write (w) and execute (x) a file: the owner (u), the group (g) and others (o).
chmod u+w file # owner may write...
Compressing and Uncompressing Files in Linux
Linux provides several tools for compressing and decompressing files. Compression reduces file size, saves storage, and makes transfers faster. Below are the most...
Fundamental Commands of Linux and Unix (with Examples and Syntax)
These are the fundamental file and directory management commands every Linux or Unix user needs.
1. List files: ls
ls
Lists files and directories in your current...
How to Display File Contents in Linux: cat, less, more, head and tail
To display a file in Linux, use cat for short files, less to page through long ones, head and tail to see the first or last lines, and tail -f to watch a log file...
How to List Files in Linux with the ls Command: Options and Examples
To list files in Linux, type ls. On its own it shows the names in the current directory; add a path to list another directory. For a full picture of a directory, use...
Linux File Hierarchy Structure
The Linux File Hierarchy Structure or the Filesystem Hierarchy Standard (FHS) defines the directory structure and directory contents in Unix-like operating systems.It...
Linux Job Control Cheat Sheet: ps, kill, bg, fg, nohup
See and control running processes:
ps -ef # all processes
ps aux --sort=-%cpu # busiest first
top # live view (P: CPU, M:...
Linux Text Processing Commands: grep, sort, uniq, wc, cut, tr and diff with Examples
Linux has a small set of commands for searching, sorting, counting and changing text in files. Each one does one job, and you chain them with a pipe (|):
grep 'text'...
Linux Wildcards and Globbing: Match File Names with *, ? and [ ] in Bash
File name pattern matching (globbing) is done by the shell, not by the command. Before ls, cp or rm runs, bash replaces a pattern with the list of matching names. *...
Linux find Command Cheat Sheet for Finding Files
The find command searches folders for files by name, size, date and more.
find . -name "*log*" # names containing "log"
find...
Linux tar and gzip Cheat Sheet: tar.gz, tgz, gunzip and zip
To pack a directory into a gzipped tarball, run tar -czf archive.tar.gz folder. To unpack it, run tar -xzf archive.tar.gz (add -C /path to choose where). gzip file...
Redirecting Command Output in Linux Bash: Files, Errors, tee
To save a command's output in a file, put > file after it (this replaces the file) or >> file (this adds to the end). Errors go to a separate stream, so add...
Understanding File and Partition Sizes in Linux
Understanding File and Partition Sizes in Linux
Managing disk space efficiently in Linux requires checking file sizes, directory sizes, and disk partitions...