xutil.dev
Login

Linux Cheatsheet

Practical Linux command cheatsheet organized by category: file operations, text processing, networking, process management, disk usage, permissions, and more for quick reference

94 commands

ls

List files and directories

cp

Copy files or directories

mv

Move or rename files/directories

rm

Remove files or directories

touch

Create empty file or update timestamp

cat

Display file contents

less

View file contents page by page

head

Display the beginning of a file

tail

Display the end of a file

ln

Create hard or symbolic links

file

Determine file type

stat

Display detailed file information

cd

Change directory

pwd

Print working directory

mkdir

Create directories

rmdir

Remove empty directories

find

Search for files and directories

locate

Fast file search using database

tree

Display directory tree structure

du

Display directory disk usage

chmod

Change file permissions

chown

Change file owner

chgrp

Change file group

umask

Set default file creation permissions

setfacl

Set file access control lists

getfacl

Get file access control lists

ps

Display running processes

top

Real-time process monitoring

htop

Interactive process viewer

kill

Send signal to a process

killall

Kill processes by name

bg

Resume stopped job in background

fg

Bring background job to foreground

nohup

Run command immune to hangups

nice

Run command with modified priority

systemctl

Manage systemd services

ip

Manage network interfaces and routing

ping

Test network connectivity

curl

Transfer data from/to a URL

wget

Download files from the web

ss

Display socket statistics

netstat

Display network connections and routing

traceroute

Trace packet route to host

dig

DNS lookup utility

nslookup

Query DNS name servers

iptables

Manage firewall rules

scp

Secure copy over SSH

rsync

Efficiently sync files

df

Display filesystem disk usage

mount

Mount a filesystem

umount

Unmount a filesystem

fdisk

Manage disk partitions

lsblk

List block devices

mkfs

Create a filesystem (format)

fsck

Check and repair filesystem

whoami

Display current username

id

Display user and group IDs

useradd

Create a new user

userdel

Delete a user

usermod

Modify a user account

passwd

Change user password

su

Switch to another user

sudo

Execute command as superuser

groups

Display user's groups

apt update

Update package lists (Debian/Ubuntu)

apt install

Install packages (Debian/Ubuntu)

apt remove

Remove packages (Debian/Ubuntu)

apt upgrade

Upgrade installed packages (Debian/Ubuntu)

apt search

Search for packages (Debian/Ubuntu)

yum install

Install packages (RHEL/CentOS)

yum remove

Remove packages (RHEL/CentOS)

yum update

Update packages (RHEL/CentOS)

dnf install

Install packages (Fedora)

uname

Display system information

hostname

Display or set hostname

uptime

Display system uptime

date

Display or set date/time

free

Display memory usage

lscpu

Display CPU information

dmesg

Display kernel messages

journalctl

View systemd journal logs

env

Display environment variables

export

Set environment variable

grep

Search for text patterns

sed

Stream editor for text transformation

awk

Pattern scanning and text processing

sort

Sort lines of text

uniq

Remove or detect duplicate lines

wc

Count lines, words, bytes

cut

Extract fields from text

tr

Translate or delete characters

diff

Compare files line by line

tee

Read stdin and write to stdout and files

xargs

Build command arguments from stdin