Linux/Kali Linux Terminal Commands
50 essential Linux and Kali Linux Terminal commands
ip addr show

Displays network interfaces & IP info

ip link set eth0 down / up

Disables/enables a network interface

dhclient eth0

Obtains IP via DHCP on eth0

ping <host>

Tests connectivity

traceroute <host>

Traces route to a remote host

tracepath <host>

Similar to traceroute, less privileged

ss -tulnp / netstat -tulnp

Shows listening ports & processes

route -n

Displays the routing table

arp -a

Shows ARP cache

nslookup <domain> / dig <domain>

DNS resolution tools

ls

Lists files and directories

cd <directory>

Changes directory

mkdir <directory>

Creates a new directory

rm <file>

Removes a file

cp <source> <destination>

Copies files

mv <source> <destination>

Moves files

chmod <permissions> <file>

Changes file permissions

chown <user>:<group> <file>

Changes file ownership

ifconfig

Displays network interface configuration

top

Displays and updates sorted information about processes

ps aux

Displays information about running processes

kill <PID>

Terminates a process

sudo <command>

Executes a command with superuser privileges

find <path> <criteria>

Finds files and directories

grep <pattern> <file>

Searches for patterns in files

sed <command> <file>

Streams a file, edits it, and saves it

awk <command> <file>

Pattern scanning and text processing language

cut <options> <file>

Removes sections from each line of files

sort <options> <file>

Sorts lines of text files

uniq <options> <file>

Reports or omits repeated lines

wc <options> <file>

Prints newline, word, and byte counts for each file

head <file>

Outputs the first 10 lines of a file

tail <file>

Outputs the last 10 lines of a file

cat <file>

Concatenates files and prints on the standard output

less <file>

Displays file contents one screen at a time

man <command>

Displays the manual page for a command

history

Displays a list of previously executed commands

echo <text>

Displays text on the terminal

printf <format> <arguments>

Formats and prints data

date

Displays the current date and time

cal

Displays a calendar

whoami

Displays the current user's username

passwd

Changes the user's password

sudo

Executes a command with superuser privileges

apt update && apt upgrade

Updates and upgrades packages (Debian/Ubuntu)

yum update

Updates packages (Red Hat/CentOS/Fedora)

dnf update

Updates packages (Fedora)

pacman -Syu

Updates packages (Arch Linux)

apt-get install <package>

Installs a package (Debian/Ubuntu)

yum install <package>

Installs a package (Red Hat/CentOS/Fedora)

dnf install <package>

Installs a package (Fedora)

pacman -S <package>

Installs a package (Arch Linux)

apt-get remove <package>

Removes a package (Debian/Ubuntu)

yum remove <package>

Removes a package (Red Hat/CentOS/Fedora)

dnf remove <package>

Removes a package (Fedora)

pacman -R <package>

Removes a package (Arch Linux)