[go: up one dir, main page]

0% found this document useful (0 votes)
6 views5 pages

Linux Commands Categorized Detailed

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views5 pages

Linux Commands Categorized Detailed

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Most Used Linux Commands (Categorized & Detailed)

File and Directory Management

ls - List directory contents with options like -l (long listing), -a (all files including hidden)

cd - Change the current directory (e.g., cd /home/user)

pwd - Print the current working directory

cp - Copy files and directories (e.g., cp source.txt dest.txt)

mv - Move or rename files or directories

rm - Remove files or directories (use -r for recursive deletion)

mkdir - Create new directories (e.g., mkdir new_folder)

rmdir - Remove empty directories

touch - Create an empty file or update the timestamp

stat - Display detailed information about a file

tree - Display directory structure in a tree-like format

File Viewing and Manipulation

cat - Display contents of a file

less - View file contents one screen at a time

more - Similar to less, but older

head - Show first N lines of a file

tail - Show last N lines of a file

cut - Remove sections from each line of files

sort - Sort lines of a file

uniq - Filter out repeated lines

wc - Count lines, words, and characters

split - Split a file into pieces

diff - Compare two files line by line

cmp - Compare two files byte by byte

File Permissions and Ownership

chmod - Change file access permissions

chown - Change file owner and group

chgrp - Change group ownership


Searching and Finding

find - Search for files in a directory hierarchy

locate - Find files using a prebuilt database

grep - Search text using patterns

which - Locate the executable of a command

whereis - Locate the binary, source, and man page for a command

type - Show how a command would be interpreted

Process Management

ps - Display currently running processes

top - Show real-time system processes

htop - Interactive process viewer (better version of top)

kill - Send signals to processes

killall - Kill processes by name

nice - Run a program with a given priority

renice - Change priority of a running process

jobs - List active jobs

fg - Bring a job to the foreground

bg - Resume a job in the background

Disk and File System Management

df - Report disk space usage

du - Estimate file space usage

mount - Mount a file system

umount - Unmount a file system

fsck - Check and repair a filesystem

blkid - Show block device attributes

lsblk - List information about block devices

fdisk - Partition a disk (for MBR)

parted - Partition a disk (for GPT)

Networking

ip - Show/manipulate routing, devices, policy routing

ifconfig - Configure network interfaces (deprecated, use ip)


ping - Send ICMP echo requests to test connectivity

netstat - Network statistics (deprecated)

ss - Dump socket statistics

traceroute - Show route to a host

nslookup - Query Internet name servers

dig - DNS lookup utility

hostname - Display or set the system's hostname

wget - Non-interactive network downloader

curl - Transfer data from or to a server

scp - Secure copy over SSH

rsync - Remote file and directory synchronization

Archiving and Compression

tar - Archive files

zip - Package and compress (e.g., zip archive.zip file)

unzip - Extract zip archives

gzip - Compress files

gunzip - Decompress files compressed with gzip

bzip2 - Compress files (better compression)

xz - Compress files (high ratio)

7z - 7-Zip compression tool

User Management

whoami - Print current user ID

id - Show user and group IDs

useradd - Add a new user

usermod - Modify a user account

userdel - Delete a user

passwd - Change user password

groupadd - Create a new group

groupdel - Delete a group

groups - Show groups of current user

su - Switch user

sudo - Run command as another user (usually root)


Package Management

apt - Package manager for Debian/Ubuntu

dpkg - Debian package manager

yum - Package manager for RHEL/CentOS

dnf - Fedora/RHEL package manager

zypper - SUSE package manager

snap - Universal package manager for Linux

flatpak - Another universal package manager

System Monitoring and Performance

uptime - Show how long the system has been running

vmstat - Report virtual memory statistics

iostat - Report CPU and I/O statistics

free - Display memory usage

sar - Collect, report, or save system activity information

dstat - Versatile resource statistics

iotop - I/O usage by processes

System Information

uname - System information

hostnamectl - View or set the hostname and related info

lsb_release - Print distribution-specific information

uptime - Show system uptime

who - Show who is logged on

dmesg - Print system boot and kernel messages

lscpu - CPU architecture information

lsmem - List memory information

lsusb - List USB devices

lspci - List PCI devices

dmidecode - Dump system's hardware info from BIOS

Others and Shortcuts

echo - Print text or variable values

date - Display or set the system date and time


cal - Display a calendar

clear - Clear terminal screen

alias - Create command shortcuts

history - Show command history

man - Display command manual

exit - Close terminal session

You might also like