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.
Get hands-on Linux mentorship from a real cybersecurity professional at MasaudSec.com. Learn exactly how these commands are used in ethical hacking and penetration testing labs.
Shows the username of the currently logged-in user.
Displays a list of previously executed commands with line numbers.
To clear history: history -c
Shows the current date and time according to the system clock.
Custom format example: date "+%Y-%m-%d %H:%M:%S"
Outputs text or variables to the terminal screen.
To display variable value: echo $HOME
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 sizesMove to a different directory in the filesystem.
Shortcuts:
cd ~ - Home directorycd .. - Parent directorycd - - Previous directoryShows the full path of your current location.
Creates a copy of a file or directory at the specified location.
To copy directories: cp -r source_dir destination_dir
Moves files/directories or renames them if destination is in same directory.
Removes files permanently (use with caution!).
To delete directories: rm -r directory_name
Warning: There is no recycle bin in Linux command line!
Makes a new directory with the specified name.
To create parent directories as needed: mkdir -p path/to/new/directory
Displays the contents of a file in the terminal.
To view with line numbers: cat -n file_name
Searches for patterns in files using regular expressions.
Case insensitive search: grep -i "pattern" file_name
Searches for files in a directory hierarchy.
Find all .txt files: find . -name "*.txt"
Changes file permissions (read, write, execute).
Common permissions:
644 - Owner RW, Group R, Others R755 - Owner RWX, Group RX, Others RXThese filesystem commands are core skills in every penetration test. Join the structured cybersecurity mentorship program at MasaudSec.com and practice in real hacking environments.
Shows currently running processes.
Common options:
ps -ef - Full format listingps -u username - User's processesTerminates a running process by ID or name.
Force kill: kill -9 1234
Kill by name: pkill process_name
Interactive process viewer (press 'q' to quit).
Alternative: htop (needs installation)
Shows disk space usage for all mounted filesystems.
Human-readable format (-h) shows sizes in KB, MB, GB.
Estimates file and directory space usage.
Options:
-s - Summary total-h - Human-readableDisplays memory usage statistics.
Shows total, used, free, shared, buff/cache, and available memory.
Grants root privileges (use with caution!).
To run a single command as root: sudo command
Warning: Root can make system-wide changes!
System configuration files (passwords, networks, services)
Variable data (logs, databases, web files)
Root user's home directory
Temporary files (cleared on reboot)
Want a mentor who teaches Linux the way it's actually used in bug bounty and penetration testing? Visit MasaudSec.com and start your real cybersecurity journey.
Displays network interface configuration.
Modern alternative: ip addr
Tests network reachability to a host.
Stop after 4 packets: ping -c 4 google.com
Connects to a remote server securely.
Common options:
-p 2222 - Connect to non-standard port-i key.pem - Use identity fileCopies files between hosts securely.
Copy from remote: scp user@remote:/path/file.txt .
Displays network connections and statistics.
Options:
-t - TCP connections-u - UDP connections-l - Listening portsAlternative to netstat with more details.
Faster and more detailed than netstat.
Learn advanced network security techniques and penetration testing from experts at MasaudSec.com.
Installs Debian package files.
Fix dependencies: sudo apt-get install -f
Updates package lists and upgrades installed packages.
For Kali Linux: sudo apt update && sudo apt full-upgrade
Uninstalls packages from the system.
Remove with config files: sudo apt purge package_name
Sets variables available to all child processes.
View all variables: printenv
Pattern matching for file operations.
Common patterns:
* - Any characters? - Single character[abc] - Any of a, b, or cExecute multiple commands in sequence.
Run regardless of success: command1; command2
Creates compressed archive files.
Extract: tar -xzvf archive.tar.gz
Simple command-line text editor.
Advanced editor: vim file.txt
Watch log files in real-time.
Show last 100 lines: tail -n 100 /var/log/syslog