Useful Linux Command Reference for Beginners
Posted on 4/13/2025, 9:40:35 PM
Linux Command Dictionary: A Beginner’s Guide
1. Getting Started
- Terminal: The command-line interface where you type Linux commands.
- Command: A typed instruction to the computer (e.g.,
ls
).
- Flag: An option that changes a command’s behavior (e.g.,
-l
).
- Argument: The target of the command (e.g., a file or directory name).
2. File & Directory Management
- ls – Lists files and folders in the current directory.
- cd – Changes the current directory.
- pwd – Displays the full path of your current directory.
- mkdir – Creates a new folder.
- touch – Creates an empty file.
- rm – Deletes files or folders.
- mv – Moves or renames files or folders.
- cp – Copies files or folders.
- tree – Shows folder structure in tree form (may need to install).
3. Viewing & Editing Files
- cat – Displays the full contents of a file.
- less – Lets you scroll through a file one screen at a time.
- head – Shows the first 10 lines of a file.
- tail – Shows the last 10 lines of a file.
- nano – Simple built-in text editor in the terminal.
- wc – Word/line/character count of a file.
- file – Identifies the file type.
4. File Permissions & Ownership
- chmod – Changes who can read/write/execute a file.
- chown – Changes the owner of a file or directory.
- ls -l – Shows detailed file info including permissions.
- umask – Displays or sets default file permissions.
5. Searching & Finding
- find – Searches for files/folders by name or property.
- grep – Finds lines in files that match text patterns.
- locate – Quickly finds file paths (requires updated database).
- which – Shows the full path of a command.
6. Package Management
- apt / apt-get – Installs packages on Debian/Ubuntu.
- yum / dnf – Used on Red Hat-based systems.
- pacman – Package manager for Arch Linux.
- snap – Manages Snap universal packages.
- flatpak – Manages Flatpak universal apps.
7. System Monitoring & Process Control
- top – Real-time process and resource monitor.
- htop – Advanced version of
top
(requires install).
- ps – Displays running processes.
- kill / killall – Stops a running process by PID or name.
- uptime – Shows how long the system has been running.
- free -h – Displays memory usage in human-readable format.
- df -h – Shows available disk space.
- du -sh * – Shows size of each item in current folder.
8. Networking Basics
- ping – Tests network connection to another machine.
- ip a – Shows network interface details.
- ifconfig – Legacy tool for network info (sometimes not installed).
- netstat -tuln – Lists open ports and listening services.
- curl – Downloads content from a URL (or sends data).
- wget – Simple download utility.
- scp – Securely copies files between machines via SSH.
- ssh – Connects to another machine securely over a network.
9. Archiving & Compression
- tar – Archives or extracts folders into .tar files.
- gzip / gunzip – Compresses or decompresses files (.gz).
- zip / unzip – Works with standard .zip files.
- 7z – Uses the high-compression 7-Zip format.
10. User Management
- adduser / useradd – Adds new users to the system.
- passwd – Changes a user’s password.
- whoami – Prints your current username.
- su / sudo – Switches user or runs command as root/admin.
11. Nano Editor Basics
- nano filename – Opens a file in the nano editor.
- Ctrl+O – Save the file.
- Ctrl+X – Exit nano.
- Ctrl+K / Ctrl+U – Cut and uncut (paste) lines.
- Ctrl+W – Search in file.
- Ctrl+\ – Find and replace text.
12. System & Shell Info
- uname -a – Shows detailed system info.
- echo $SHELL – Displays the shell you’re using.
- env – Lists all environment variables.
- history – Shows recently used commands.
- alias – Creates a custom command shortcut.
- man – Displays the full manual for a command.
- --help – Provides a quick summary of a command’s options.
13. Fun & Useful Extras
- cowsay – Displays a talking ASCII cow (just for fun).
- fortune – Prints a random quote or message.
- neofetch – Shows system info in a flashy way.
- cal – Displays a calendar.
- date – Displays current system time and date.
Back to Blog