0% found this document useful (0 votes)
4 views

Linux commands

This document is a comprehensive reference chart for Linux commands organized by categories such as File System & Navigation, File Viewing & Editing, and System Updates. Each command is accompanied by a brief description of its functionality. It serves as a quick guide for users to efficiently navigate and manage their Linux systems.

Uploaded by

suresh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Linux commands

This document is a comprehensive reference chart for Linux commands organized by categories such as File System & Navigation, File Viewing & Editing, and System Updates. Each command is accompanied by a brief description of its functionality. It serves as a quick guide for users to efficiently navigate and manage their Linux systems.

Uploaded by

suresh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Linux Commands Reference Chart

Category Command Description


File System & cd <directory> Change to a specified directory.
Navigation
ls List files and directories in the current directory.
pwd Print the current working directory.
mkdir <dir_name> Create a new directory.
rmdir <dir_name> Remove an empty directory.
rm -rf <file/dir> Remove files or directories forcefully (be cautious!).
cp <source> <destination> Copy files or directories.
mv <source> <destination> Move or rename files/directories.
File Viewing & Editing cat <file> Display contents of a file.
less <file> View the contents of a file page-by-page (use arrow keys to
scroll).
nano <file> Open a file for editing using Nano text editor.
vim <file> Open a file for editing using Vim text editor.
head <file> View the first 10 lines of a file (can use -n for specific lines).
tail <file> View the last 10 lines of a file (can use -n for specific lines).
grep <pattern> <file> Search for a pattern in a file.
Permissions chmod <permissions> <file> Change the permissions of a file or directory (e.g., chmod 755
file.sh).
chown <user>:<group> <file> Change the owner and/or group of a file.
sudo <command> Run a command with superuser (root) privileges.
umask Set default file permissions for newly created files.
Networking ping <host> Check network connectivity to a host.

Page | 1
netstat Display network connections, routing tables, and interface
statistics.
ss Socket statistics (more advanced than netstat).
ifconfig / ip a Show network interfaces and their configuration.
curl <url> Transfer data from or to a server (works for HTTP, FTP, etc.).
wget <url> Download files from a URL.
System Monitoring top Display real-time system processes and resource usage.
htop Interactive, enhanced version of top (installable via apt install
htop).
ps aux Show all currently running processes on the system.
df -h Display disk space usage of filesystems in a human-readable
format.
du -sh <dir> Show the disk usage of a directory.
free -h Display system memory usage in a human-readable format.
Disk & File System fdisk -l List partition tables for storage devices.
mount <device> Mount a storage device to a directory.
<mount_point>
umount <mount_point> Unmount a storage device.
fsck <device> Check and repair a filesystem.
Process Management kill <pid> Terminate a process by its process ID.
killall <process_name> Terminate all instances of a process by name.
bg Move a job to the background.
fg Bring a job to the foreground.
nohup <command> Run a command immune to hangups (useful for long-running
processes).
Archiving & tar -cvf <archive.tar> <dir> Create a .tar archive from a directory.
Compression
Page | 2
tar -xvf <archive.tar> Extract a .tar archive.
gzip <file> Compress a file using gzip (creates .gz file).
gunzip <file.gz> Decompress a .gz file.
zip <file.zip> <file1> <file2>
Create a zip archive.
unzip <file.zip> Extract files from a zip archive.
System Updates apt-get update Update package lists for Ubuntu/Debian-based systems.
apt-get upgrade Upgrade installed packages for Ubuntu/Debian-based systems.
yum update Update packages for RHEL/CentOS-based systems.
dnf upgrade Upgrade packages for Fedora-based systems.
System Info uname -a Display detailed system information (kernel version, architecture,
etc.).
uptime Display the system uptime and load averages.
lscpu Show information about the CPU architecture.
lsblk List information about all available block devices (disks).
free -h Display memory usage in a human-readable format.
Search & Find find <path> -name <filename> Search for files by name.
locate <filename> Locate a file on the system using a pre-built index (faster than
find).
which <command> Find the location of an executable command.
Text Processing awk '{print $1}' <file> Process and print specific columns from a file.
sed 's/old/new/g' <file> Stream editor to replace text in a file.
cut -d' ' -f1 <file> Extract specific fields from a file.
Package Management dpkg -l List installed packages (Debian/Ubuntu).
rpm -qa List installed packages (RedHat/CentOS).
apt-get install <package> Install a package (Ubuntu/Debian).
yum install <package> Install a package (CentOS/RHEL).

Page | 3

You might also like