Linux Cheatsheet
Linux Cheatsheet
Linux Cheatsheet
Basic File Operations Search File Location File Comparison Viewing Processes Spell Checking Linux Listing Commands
ls list files in a directory. It does more than that. fd a simple, fast and user-friendly alternative to find. diff line-by-line comparison of two files or directories. ps list process. look look up the spelling of a word quickly. lsattr List file attributes on a Linux second extended
file system.
exa exa is a modern replacement for ls. locate searches the file system for files and directories vimdiff edit two, three, or four versions of a file with procs a modern replacement for ps written in Rust. aspell Interactive spelling checker.
cheatsheet
whose name matches a given pattern. Vim and show their differences. lsb_release prints certain LSB (Linux Standard Base)
lsd the next gen file listing command. pgrep searches for processes currently running on spell Batch spelling checker. and Distribution information.
backwards compatible with ls. find searches for files and directories in a directory comm line-by-line comparison of two sorted files. the system, based on a complete or partial process
hierarchy based on a user given expression and name, or other specified attributes. lsblk List block devices.
cp copy a file. can perform user-specified action on each matched cmp Byte-by-byte comparison of two files.
file. uptime view the system load. Disks and Filesystems ls List information about file(s).
mv rename (“move”) a file. md5sum compute a checksum of the given files (MD5).
which locate executables in your search path (command). w list active processes for all users. df get a full summary of available and used disk space lsof List open files.
rm delete (“remove”) a file. usage of the file system on the Linux system.
fzf a general purpose command-line fuzzy finder. top monitor resource-intensive processes interactively. lspci List all PCI devices.
rmdir utility for deleting empty directories. Directory Operations fdisk check the partitions on a disk.
whereis locate executables, documentation, and source files. htop a cross-platform interactive process viewer. lsmem shows the memory block size, the device size,
ln create links (alternative names) to a file. cd change your current directory. duf a better df alternative, used to show disk usage. and the amount of memory in online and
type locate executables in your search path (bash built-in). gtop system monitoring dashboard for terminal. offline state.
shred completely erase a file when it’s deleted. zoxide zoxide is a smarter cd command. du measure disk usage of files and directories.
hyperfine a command-line benchmarking tool. User Account Management
rename rename files or multiple fiies tree recursively list or display the content of a dust a more intuitive version of du written in rust.
File Compression and Packaging directory in a tree-like format. glances glances an Eye on your system. A top/htop useradd add user accounts to your system.
alternative for GNU/Linux, BSD, Mac OS and mount make a disk partition accessible.
tar package multiple files into a single file. broot new way to see and navigate directory trees. Windows operating systems. adduser also used to add user accounts to your system.
unmout Unmount a disk partition (make it inaccessible).
Print Text gzip compress files with GNU Zip. pwd print the name of your current directory. btop++ resource monitor that shows usage and stats for
Print Text processor, memory, disks, network and processes. fsck check a disk partition for errors. userdel used to delete user accounts from your system.
gunzip uncompress GNU Zip files. basename Print the last part of a file path.
echo print simple text on standard output. sync flush all disk caches to disk. usermod used to change or modify user properties.
bottom yet another cross-platform graphical
bzip2 compress files in BZip format. dirname Print a file path without its last part. process/system monitor. passwd change user password.
printf print formatted text on standard output. sfdisk another utility with a purpose similar to fdisk, but
buzip2 uncompress BZip files. mkdir create (make) a directory. iotop used to display and monitor the disk IO usage with more features. It can display the size of each
yes print repeated text on standard output. partition in MB. chfn change a user’s personal information.
details and even gets a table of existing
@linuxopsys
bzcat compress/uncompress BZip files via rm -r Delete a nonempty directory and IO utilization by the process. chsh Change a user’s shell.
seq print a sequence of numbers on standard output. its contents. lsblk lists out all the storage blocks, which includes disk
standard input/output.
powertop used to diagnose issues with power consumption partitions and optical drives.
clear Clear the terminal screen or window. and power management.
compress compress files with traditional Users and Their Environment
Unix compression. hwinfo a general purpose hardware information tool and
File Text Manipulation free display free memory. can be used to print out the disk and partition list.
logname show the name of the current user. Math and Calculations
uncompress uncompress files with traditional
grep find lines in a file that match a regular expression. pidof command, which looks up and prints the PID of a quota Display disk usage and limits.
Unix compression. whoami print your current, effective username. xcalc Display a graphical calculator.
File Creation and Text Editors process by its name.
ripgrep An extremely fast alternative to grep that respects
zcat compress/uncompress file via standard id Print the user ID and group membership of a user. expr Evaluate simple math on the command line.
your gitignore.
touch create, change and modify timestamps of a file. input/output (gzip or compress). Network Commands
ack ack is a grep-like source code search tool. Controlling Processes who List logged-in users, long output. dc Text-based calculator.
emacs text editor from Free Software Foundation. zip compress files in Windows Zip format. ifconfig use without parameters to obtain generic
ag a code searching tool similar to ack, but faster. kill terminate a process (or send it a signal). information about network connections. users List logged-in users, short output. bc Arbitrary precision calculator language
vim text editor, extension of Unix vi. unzip uncompress Windows Zip files. Also used to assign IP addresses and
sed stream editor used for text substitution , find & killall kills all processes that the user is able to kill, configure networking settings for finger Print information about users.
nano an easy to use command line text editor. replace but it can also perform other text potentially shutting down the system if run by root. interface devices. Miscellaneous
manipulations like insertion, deletion, search etc. last Determine when someone last logged in.
soffice office suite for editing MS Office documents. wget downloads things from the internet.
File Viewing pkill sends signals to the processes of a running program help the simplest way to get information regarding a
sd an intuitive find & replace CLI (sed alternative). based on given criteria. printenv displays the values of environment variables built-in shell command.
tee use with a pipe, reads standard input (stdin) and netstat display network statistics. in the current shell.
cat print file contents to the standard output.
writes it to both standard output (stdout) jq sed for JSON data. nohup short for no hang up, it runs the process even after
ping check connectivity between end points. man used to display the user manual of any command
and one or more files. logging out from the shell/terminal.
tac print file contents in reverse. that we can run on the terminal.
awk/gawk AWK command in Unix is used for pattern Group Management
nice invoke a program at a particular priority. dig quiry DNS servers.
bat a cat clone with syntax highlighting. processing and scanning. tdrl A community effort to simplify man pages with
curl transfer data to or from a server. groups print the group membership of a user. practical examples.
glow terminal based markdown reader. cut extract columns from a file.
renice change a process’s priority as it runs. cheat create and view interactive cheatsheets on
ssh securely manage remotes systems. groupadd used to create groups.
more view text files one page at a time. choose a human-friendly and fast alternative to cut and the command-line.
File Properties and Metadata cpulimit sends the SIGSTOP and SIGCONT signals to a
sometimes awk. groupdel Delete a group.
process, both to verify that it can control it and to ftp transfer files between hosts.
stat display attributes of files and directories.
less view text files one page at a time. whatis get a one-line manual page descriptions of any
paste append columns. limit the average amount of CPU it consumes. command you can run on the terminal.
ip used for configuring network interfaces. groupmod Modify a group.
head view the first lines of a text file.
wc count bytes, words, lines in a file or STDIN.
tr translate characters into other characters. r ZSH built-in used to execute the previous command.
traceroute prints the route that a packet takes to
tail view the last lines of a text file.
file Identify (guess) the type of a file. Scheduling Jobs reach the host.
sort sort lines of text by various criteria. Shell Job Control history a very useful command to show you all of the last
touch change timestamps of files and directories.
nl view text files with their lines numbered.
route view and manipulate the IP routing table. commands that have been recently used.
uniq locate identical lines in a file. sleep Wait a set number of seconds, doing nothing. jobs used to list the jobs that you are running in the
chmod change the access mode of a file.
strings display text that’s embedded in a binary file.
rsync, scp, sftp local and remote file copy (transfer).
background and in the foreground. mcfly fly through your shell history.
watch Run a program at set intervals. The watch command
od view data in octal (or other formats). can be used to repeat a command at fixed intervals. & Run a job in the background. xargs used in a UNIX shell to convert input from standard
chgroup change group ownership of files and directories. The default interval is 2 second.the interval can be input into arguments to a command.
xxd View data in hexadecimal. changed with -n option ^z Suspend the current (foreground) job.
chown change owner of files and directories. Logins, Logouts, and Shutdowns
acroread View PDF files. at a Linux command-line utility used to schedule a Host Information suspend Suspend a shell.
umask set a default mode for new files and directories. shudown Halts or reboots a Linux system. job for later execution Dates and Times
gv View PostScript or PDF files. uname Print basic system information. fg Unsuspend a job: bring it into the foreground.
chattr change extended attributes of files and directories. halt used to instruct the hardware to stop all the crontab Crontab stands for “cron table”. date Print or set the date and time.
xdvi View TeX DVI files. CPU functions. Basically, it reboots or stops the system. It allows to use job scheduler, which is hostname Print the system’s hostname. bg Make a suspended job run in the background.
lsattr list extended attributes of files and directories. known as cron to execute tasks. cal Print a calendar.