SSH cheat sheet
Posted by Chris E on 01 March 2010 02:40 PM
File Manipulation

ls -l ---- This Will List All Files/Directories In Your Current Directory
ls -al ---- Lists All Files & Information
ls –alR ---- Lists All Files & Information In All SubDirectories
cd ---- Changes Directory
clear ---- Clears The Screen
cp [oldfilepath] [newfilepath] ---- Copies File From A Directory->Another
rm [filepath] ---- Removes A File
rm * ---- Removes All Files In A Directory
mkdir [dirname] ---- Creates A New Directory
mv [oldfilepath] [newfilepath] ---- Moves A File/Directory


unzip []----Unzips A .ZIP File
tar -xvf [filepath.tar]----Untars A .TAR File
gzip -d [filepath.gz]----Ungzips A .GZIP File
gzip -d filepath.tar.gz----Ungziptar's A .TAR.GZ File
tar -xvf filepath.tar


0 = --- No Permission
1 = --X Execute-Only
2 = -W- Write-Only
3 = -WX Write & Execute
4 = R-- Read-Only
5 = R-X Read & Execute
6 = RW- Read & Write
7 = RWX Read, Write & Execute

You Need To Set This On Files For
Owner - The File Owner
Group - People On The Server
User - Everyone

Its normally best if you want to keep a file really secure, to keep Group as "0" to stop people on the server from looking/changing it!

System Information Commands

du----Shows Disk Usage
netstat----This Tells You Who Is Connected To The Server + Hostname
netstat -n----This Tells You Who Is Connected To The + IP
kill----Kill A System Process
top----Gives You System Information (e.g. Processes, RAM usage etc)
ps----Shows Currently Running Processes
ps U [username]----Shows Currently Running Processes By A User
last----Tells You The Last User To Login
(502 vote(s))
Not helpful