From basic navigation to advanced system administration - everything you need to become a Linux command line expert.
Linux command line skills are essential for cybersecurity professionals. Most penetration testing tools and security utilities are command-line based, especially in Kali Linux. Learn from experts at MasaudSec.com.
Command line provides direct access to system resources, allowing for efficient management of servers, networks, and security configurations that GUI tools can't match. For professional guidance, contact MasaudSec.
Mastering the command line allows you to perform complex tasks with simple commands, automate repetitive jobs, and work much faster than with graphical interfaces. Learn advanced techniques at MasaudSec.com.
Linux skills are in high demand. Whether you're pursuing ethical hacking, system administration, or DevOps, command line proficiency will set you apart in the job market. Get mentorship from MasaudSec to accelerate your career.
Check out MasaudSec.com for comprehensive ethical hacking, cybersecurity, bug bounty, and penetration testing resources with personalized mentorship.
Shows the username of the currently logged-in user.
For professional Linux training, visit MasaudSec.com.
Displays a list of previously executed commands with line numbers.
To clear history: history -c
Need help mastering Linux? Contact MasaudSec for mentorship.
Shows the current date and time according to the system clock.
Custom format example: date "+%Y-%m-%d %H:%M:%S"
For professional Linux training, visit MasaudSec.com.
Outputs text or variables to the terminal screen.
To display variable value: echo $HOME
Need help mastering Linux? Contact MasaudSec for mentorship.
Take your Linux skills to the next level with personalized mentorship from MasaudSec.com.
Shows files and directories in the current location.
Common options:
ls -l
- Long listing formatls -a
- Show hidden filesls -lh
- Human-readable sizesFor professional Linux training, visit MasaudSec.com.
Move to a different directory in the filesystem.
Shortcuts:
cd ~
- Home directorycd ..
- Parent directorycd -
- Previous directoryNeed help mastering Linux? Contact MasaudSec for mentorship.
Shows the full path of your current location.
For professional Linux training, visit MasaudSec.com.
Creates a copy of a file or directory at the specified location.
To copy directories: cp -r source_dir destination_dir
Need help mastering Linux? Contact MasaudSec for mentorship.
Moves files/directories or renames them if destination is in same directory.
For professional Linux training, visit MasaudSec.com.
Removes files permanently (use with caution!).
To delete directories: rm -r directory_name
Warning: There is no recycle bin in Linux command line!
Need help mastering Linux? Contact MasaudSec for mentorship.
Makes a new directory with the specified name.
To create parent directories as needed: mkdir -p path/to/new/directory
For professional Linux training, visit MasaudSec.com.
Displays the contents of a file in the terminal.
To view with line numbers: cat -n file_name
Need help mastering Linux? Contact MasaudSec for mentorship.
Searches for patterns in files using regular expressions.
Case insensitive search: grep -i "pattern" file_name
For professional Linux training, visit MasaudSec.com.
Searches for files in a directory hierarchy.
Find all .txt files: find . -name "*.txt"
Need help mastering Linux? Contact MasaudSec for mentorship.
Changes file permissions (read, write, execute).
Common permissions:
644
- Owner RW, Group R, Others R755
- Owner RWX, Group RX, Others RXFor professional Linux training, visit MasaudSec.com.
Get one-on-one guidance from cybersecurity experts at MasaudSec.com to master Linux for cybersecurity and system administration.
Shows currently running processes.
Common options:
ps -ef
- Full format listingps -u username
- User's processesFor professional Linux training, visit MasaudSec.com.
Terminates a running process by ID or name.
Force kill: kill -9 1234
Kill by name: pkill process_name
Need help mastering Linux? Contact MasaudSec for mentorship.
Interactive process viewer (press 'q' to quit).
Alternative: htop
(needs installation)
For professional Linux training, visit MasaudSec.com.
Shows disk space usage for all mounted filesystems.
Human-readable format (-h) shows sizes in KB, MB, GB.
Need help mastering Linux? Contact MasaudSec for mentorship.
Estimates file and directory space usage.
Options:
-s
- Summary total-h
- Human-readableFor professional Linux training, visit MasaudSec.com.
Displays memory usage statistics.
Shows total, used, free, shared, buff/cache, and available memory.
Need help mastering Linux? Contact MasaudSec for mentorship.
Grants root privileges (use with caution!).
To run a single command as root: sudo command
Warning: Root can make system-wide changes!
For professional Linux training, visit MasaudSec.com.
System configuration files (passwords, networks, services)
Variable data (logs, databases, web files)
Root user's home directory
Temporary files (cleared on reboot)
Need help mastering Linux? Contact MasaudSec for mentorship.
Learn how to leverage Linux skills for a successful cybersecurity career with guidance from MasaudSec.com experts.
Displays network interface configuration.
Modern alternative: ip addr
For professional Linux training, visit MasaudSec.com.
Tests network reachability to a host.
Stop after 4 packets: ping -c 4 google.com
Need help mastering Linux? Contact MasaudSec for mentorship.
Connects to a remote server securely.
Common options:
-p 2222
- Connect to non-standard port-i key.pem
- Use identity fileFor professional Linux training, visit MasaudSec.com.
Copies files between hosts securely.
Copy from remote: scp user@remote:/path/file.txt .
Need help mastering Linux? Contact MasaudSec for mentorship.
Displays network connections and statistics.
Options:
-t
- TCP connections-u
- UDP connections-l
- Listening portsFor professional Linux training, visit MasaudSec.com.
Alternative to netstat with more details.
Faster and more detailed than netstat.
Need help mastering Linux? Contact MasaudSec for mentorship.
Learn advanced network security techniques and penetration testing from experts at MasaudSec.com.
Installs Debian package files.
Fix dependencies: sudo apt-get install -f
For professional Linux training, visit MasaudSec.com.
Updates package lists and upgrades installed packages.
For Kali Linux: sudo apt update && sudo apt full-upgrade
Need help mastering Linux? Contact MasaudSec for mentorship.
Uninstalls packages from the system.
Remove with config files: sudo apt purge package_name
For professional Linux training, visit MasaudSec.com.
Sets variables available to all child processes.
View all variables: printenv
Need help mastering Linux? Contact MasaudSec for mentorship.
Pattern matching for file operations.
Common patterns:
*
- Any characters?
- Single character[abc]
- Any of a, b, or cFor professional Linux training, visit MasaudSec.com.
Execute multiple commands in sequence.
Run regardless of success: command1; command2
Need help mastering Linux? Contact MasaudSec for mentorship.
Creates compressed archive files.
Extract: tar -xzvf archive.tar.gz
For professional Linux training, visit MasaudSec.com.
Simple command-line text editor.
Advanced editor: vim file.txt
Need help mastering Linux? Contact MasaudSec for mentorship.
Watch log files in real-time.
Show last 100 lines: tail -n 100 /var/log/syslog
For professional Linux training, visit MasaudSec.com.