Essential Linux Commands: A Practical Reference
Classified in Computers
Written at on English with a size of 3.95 KB.
Essential Linux Commands
File and Directory Management
mkdir
: Create a new directory.ls
: List contents of a directory.rm
: Remove files or directories (-r
for recursive).cp
: Copy files or directories.mv
: Move or rename files or directories.cat
: Display file contents or create files.less
: View file contents one page at a time.head
: Display the first 10 lines of a file.tail
: Display the last 10 lines of a file.
System Information
uname
: Show system information (kernel, version, etc.).top
: Display running processes and resource usage.df
: Show disk space usage.df -h
: Show disk usage in human-readable format.free
: Display memory usage (RAM and swap).
File Creation and Editing
touch
: Create an empty file or update its timestamp.echo
: Write text to a file or print to terminal.cat
: Create or display file contents.nano
: Open a simple terminal-based text editor.
Networking and Connectivity
ip
: Show or configure network interfaces.ping
: Check connectivity to a network host.traceroute
: Trace packet paths to a destination.netstat
: Show network connections and statistics.nmap
: Scan networks for hosts and open ports.tcpdump
: Capture and display network packets.wireshark
: GUI tool for analyzing network traffic.
File Searching and Compression
grep
: Search for patterns in files.tar
: Archive files and directories (-cvf
to create).zip
: Compress files into a.zip
archive.unzip
: Extract files from a.zip
archive.
User Management
sudo adduser
: Add a new user.sudo deluser
: Remove a user.passwd
: Change a user’s password.su
: Switch to another user or superuser.apt
: Manage packages (install, update, remove).apt-get
: Alternative package manager (similar toapt
).
Process and System Management
killall
: Kill processes by name.sudo systemctl
: Manage system services (start, stop, restart).
Other Useful Commands
history
: Show previously executed commands.chmod
: Change file permissions.chown
: Change file ownership or group.sudo
: Execute commands with elevated (root) privileges.man
: Display the manual for a command.