This repository contains a curated list of useful Linux commands and shell scripts for everyday use, system management, and automation.
cd <directory>: Change to a specific directory.ls: List files and directories.pwd: Print the current working directory.mkdir <dir_name>: Create a new directory.
cp <source> <destination>: Copy files or directories.mv <source> <destination>: Move or rename files.rm <file_name>: Remove files or directories.touch <file_name>: Create a new empty file.
cat <file_name>: View the contents of a file.less <file_name>: View files one page at a time.nano <file_name>: Edit a file using the nano text editor.vim <file_name>: Edit a file using the Vim editor.
grep <pattern> <file_name>: Search for a pattern within a file.find <directory> -name <file_name>: Search for a file by name.locate <file_name>: Locate a file quickly in the system.
chmod <permissions> <file_name>: Change file permissions.chown <owner>:<group> <file_name>: Change file owner and group.
top: Display running processes.df -h: Check disk space usage.free -m: Display memory usage.uname -a: Show system information.
ping <hostname>: Check network connectivity.ifconfig: Display network interfaces and IP addresses.netstat -tuln: Display listening ports.curl <url>: Fetch data from a URL.
ps aux: Show currently running processes.kill <PID>: Kill a process by its PID.top: Monitor active processes in real-time.
lsblk: List all block devices.mount <device> <directory>: Mount a file system.umount <device>: Unmount a file system.
- Create a basic shell script to automate tasks like backups, system updates, or file management.
#!/bin/bash
# A simple script to back up a directory
tar -czvf backup.tar.gz /home/user/documents/