Linux Commands
Linux Commands
a
● chgrp - Change group ownership of a file
an
● passwd - Change user password
● cd - Change directory
N
1
● touch - Create empty files
3. File Management
a
● more - View file content page by page
an
● less - View file content with navigation
2
● updatedb - Update the database used by locate
a
● chgrp - Change group ownership
an
● umask - Set file creation mask
5. Disk Management
3
● lsblk - List information about block devices
a
● resize2fs - Resize an ext2, ext3, or ext4 file system
an
● lvcreate - Create a logical volume
6. Process Management
4
● kill - Terminate a process by ID
a
● pgrep - Search for processes by name or other attributes
an
● pkill - Kill processes by name or other attributes
● lsof - List open files and the processes that opened them
ay
● strace - Trace system calls and signals
7. Network Management
5
● ip link set <interface> up/down - Enable or disable a
network interface
a
● dig <domain> - Query DNS records
an
● nslookup <domain> - Lookup DNS details
6
● dmesg - Print system boot and hardware logs
a
● sar -u 5 10 - Monitor CPU usage at 5-second intervals
an
● iotop - Display disk read/write usage per process
systems)
7
9. Text Processing
a
● grep '<pattern>' <file> - Search for a pattern in a file
an
● grep -r '<pattern>' <directory> - Recursively search
for a pattern in a directory
8
● cmp <file1> <file2> - Compare two files byte by byte
a
● apt install <package> - Install a package
an
● apt remove <package> - Remove a package
9
● dnf update - Update installed packages (for newer systems)
a
● yum list installed - List installed packages
an
● dnf list installed - List installed packages (newer
distros)
10
● tar -czvf archive.tar.gz <files> - Create a
compressed tar.gz archive
a
● unzip archive.zip - Extract a zip archive
an
● unzip -l archive.zip - List contents of a zip file
11
● shutdown -h 22:00 - Schedule shutdown at 10:00 PM
a
● systemctl reboot - Reboot using systemd
an
13. Task Scheduling
12
● journalctl --since "1 hour ago" - View logs from the
last hour
a
● uptime - Show system uptime and load
13