Operations 6 min read

Common Linux Command Cheat Sheet for File, Process, Network, System, and Package Management

This guide provides a concise reference of essential Linux commands for file handling, process control, networking, system information, and package management, helping users quickly perform common administrative tasks from the command line.

Test Development Learning Exchange
Test Development Learning Exchange
Test Development Learning Exchange
Common Linux Command Cheat Sheet for File, Process, Network, System, and Package Management

File Management

ls — display directory contents.

ls -l — show detailed information.

cd /path/to/directory — change the current working directory.

mkdir new_directory — create a new directory.

rm filename — delete a file.

rm -r directory — recursively delete a directory.

cp file1 file2 — copy a file.

cp -r dir1 dir2 — copy a directory recursively.

mv file1 file2 — move or rename a file.

mv dir1 dir2 — move or rename a directory.

touch newfile.txt — create an empty file or update its timestamp.

cat filename — display file contents.

less filename — view file contents page by page.

grep pattern filename — search for a pattern in a file.

find /path -name "filename" — locate files by name.

chmod 755 filename — change file permissions.

chown user:group filename — change file ownership.

Process Management

ps aux | grep process_name — display process information.

top — monitor system resource usage in real time.

kill PID — terminate a process.

killall process_name — terminate all processes with the given name.

nice -n 19 ./process — set process priority.

renice -n 19 -p PID — dynamically change process priority.

Network Tools

ping www.example.com — test network connectivity.

traceroute www.example.com — trace the path packets take to a host.

netstat -tuln — display network connections and routing tables.

ifconfig eth0 up — show or configure network interfaces.

curl http://www.example.com — transfer data from or to a server.

wget http://www.example.com/file.tar.gz — download files from the internet.

ssh user@remote_host — securely log into a remote machine.

scp file user@remote_host:/path — securely copy files.

nc -l -p 8080 — network debugging and probing.

iptables -A INPUT -p tcp --dport 80 -j ACCEPT — configure firewall rules.

System Management

df -h — display disk space usage.

du -sh directory — show size of a directory or file.

free -m — display memory usage.

uname -a — show system information.

date — display or set the system date and time.

cal — display a calendar.

whoami — show the current user name.

su - user — switch user.

sudo apt-get update — run a command with administrative privileges.

tar -czvf archive.tar.gz directory — create a compressed archive.

gzip file — compress a file.

gunzip file.gz — decompress a file.

Package Management

sudo apt-get install package_name — install a package on Debian/Ubuntu.

sudo yum install package_name — install a package on CentOS/RHEL.

sudo dnf install package_name — install a package on Fedora.

rpm -q package_name — query an RPM package.

dpkg -i package.deb — install a Debian package.

pip install package_name — install a Python package.

npm install package_name — install a Node.js package.

tail -f /var/log/syslog — display the end of a log file and follow new entries.

sudo logrotate /etc/logrotate.conf — rotate log files automatically.

process managementLinuxCommand LineSystem Administrationfile managementNetwork Tools
Test Development Learning Exchange
Written by

Test Development Learning Exchange

Test Development Learning Exchange

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.