Linux Command Cheat Sheet
Linux Command Cheat Sheet
cd
cd -
cd ~
cd ../
ls
ls -al
ls -ltr
man ls
mkdir
Allows a user to create a directory - Example: mkdir
mynewDirectory
mkdir -p 1/2
rmdir dir1
rm file
rm file*
rm -r oldir
Will Recursively remove oldir & and all folder contents
touch fileX
cat f1 f2
nano file1
vim file1
leafpad f1
Leafpad graphical file editor (in XCFE, easiest)
ristretto f.jpg
wget www
grep XX [file]
grep "^Nmap"
date
date +%y-%m-%d
$(date +%y-%m-%d)
Prints out all usernames on a system, cut the 1st column, and
email it to me.
sudo su -
Super User Do, run the "su -" command to become root (if
allowed)
ps auxw | less
List all processes, their PID #s, stats and process names (with
less pager)
pstree | less
Be Careful
ifconfig eth0
Show IP and VLSM(255) subnet mask
hostname -f
hostname -i
ping -c 3 8.8.8.8
netstat -antp
*Show (a)ll local to remote (T)CP IP/port connections &
(p)rocess names
iptables -L -n
route -n
nmap -O -n - [IP/N]
Have netcat listen locally on [your IP#] and [port#] * root needed
for ports under 1024
Scan webserver for known vulnerabilities. This command must be run as root, or via sudo
command. WARNING! Do not run this without the target-host or network owner's permission.