Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 59Raaj/fb1ca369ecb962e8004afdd58c2cd696 to your computer and use it in GitHub Desktop.
Save 59Raaj/fb1ca369ecb962e8004afdd58c2cd696 to your computer and use it in GitHub Desktop.

Linux Commands Handbook: Essential Commands for Beginners

Linux commands are the backbone of working with the Linux operating system. Whether you're a developer, sysadmin, or just starting out, this handbook covers the most essential commands to help you navigate and manage Linux efficiently.


1. Navigation Commands

Command Description
pwd Print the current working directory.
ls List files and directories.
ls -l List files in long format (detailed view).
ls -a List all files, including hidden ones.
cd <directory> Change to a specific directory.
cd .. Move up one directory level.
cd ~ Navigate to the home directory.

2. File Management Commands

Command Description
touch <file> Create an empty file.
mkdir <dir> Create a new directory.
rm <file> Remove a file.
rm -r <dir> Remove a directory recursively.
cp <src> <dest> Copy a file or directory.
mv <src> <dest> Move or rename a file/directory.
cat <file> Display the contents of a file.
nano <file> Open a file in the Nano text editor.
chmod <perms> Change file permissions (e.g., chmod 755).

3. System Information Commands

Command Description
uname -a Display system information.
df -h Show disk space usage in human-readable format.
free -h Display memory usage.
top Display real-time system processes.
ps aux List all running processes.
whoami Display the current user.

4. Networking Commands

Command Description
ping <host> Check connectivity to a host.
ifconfig Display network interface information.
ssh <user@host> Connect to a remote server via SSH.
scp <file> <dest> Securely copy files between hosts.
wget <url> Download files from the web.
curl <url> Transfer data from or to a server.

5. Package Management Commands

Command Description
sudo apt update Update package list (Debian/Ubuntu).
sudo apt install <package> Install a package (Debian/Ubuntu).
sudo apt remove <package> Remove a package (Debian/Ubuntu).
sudo yum install <package> Install a package (CentOS/RHEL).
sudo yum remove <package> Remove a package (CentOS/RHEL).
sudo dnf install <package> Install a package (Fedora).

6. Miscellaneous Commands

Command Description
grep <pattern> Search for a pattern in files.
find <dir> -name <file> Search for files in a directory.
tar -czvf <archive.tar.gz> <dir> Create a compressed archive.
tar -xzvf <archive.tar.gz> Extract a compressed archive.
history View command history.
clear Clear the terminal screen.

7. Quick Tips

  • Use man <command> to view the manual for any command.
  • Use sudo to execute commands with superuser privileges.
  • Use Ctrl+C to stop a running command.
  • Use Ctrl+Z to pause a process.

This handbook is a great starting point for anyone diving into Linux. Save it, share it, and let me know your favorite Linux commands in the comments! 🐧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment