Useful Linux Commands
For those new to Linux, here's a handy list of bash commands that I use frequently, along with a brief description of what they're used for.
Ls
Lists the contents of a directory.
Top
Display running Linux tasks & processes, similar to task manager but inside a shell/command prompt/terminal window.
Ps
Reports the process status and process ID.
Kill
Cancels a job. You need the PID to kill the job. Use TOP or PS to find it.
Example: Kill 11969
history
Shows a list of recent commands you've run from the command line.
ifconfig
Find out your IP address.
route -n
Find the IP address of your default gateway.
ping
Test network connectivity.
traceroute
Shows amount of routers you have to go through in order to reach a particular host.
host
Look up the IP address of a fully qualified domain name.
iwlist
Gather information from a wireless interface. (Needs to be run as root)
Example: iwlist wlan0 scan
iwconfig
Similar to ifconfig, but for your wireless interfaces.
free
Show used/free memory and swap space.
Example: free -m
mount
Display mounted filesystems.
df
Show disk space usage.
Example: df -h
du
Shows disk space usage directories.
Example: du -hc Documents/
head
Displays first few lines of a file.
tail
Displays last few lines of a file.
type
Find which directory a command is in.
Example: type ifconfig
locate
Locate an arbitrary file on the filesystem.
Example: locate nameoffile.txt
Reader Comments