Back to Programming Articles

List of SSH Commands
by HMBeaty 02 Sep 2011

Feel free to add more to the list if you have any as I'm sure there are more that I've missed

Display everything in the current directory
Code:
ls
Display all files, including hidden files
Code:
ls -a
Display all files, along with the size and timestamp
Code:
ls -l
Uncompress tar.gz files
Code:
tar -zxpf file.tar.gz
Uncompress .tar files
Code:
tar -xpf file.tar.gz
Uncompress .gz files
Code:
gunzip file
Copy a file to a new file
Code:
cp file
Move a file to a new file, or rename
Code:
mv file
Create a directory
Code:
mkdir dir
Delete a directory
Code:
rmdir dir
Delete a directory
Code:
rm -rf dir
Delete a file
Code:
rm file
Move to a directory
Code:
cd dir
Move to a lower directory
Code:
cd ..
Move to the home directory
Code:
cd ~
Move to the previous directory
Code:
cd -
View processes and server loads (press 'q' to stop viewing)
Code:
top
Create or edit a file
Code:
vi file
Display the current directory
Code:
pwd
Edit a file
Code:
pico file
Edit a file
Code:
nano file
Connect to a FTP server
Code:
ftp site
View a webpage
Code:
lynx site
Display the hard drive stats
Code:
df
Display your quota
Code:
quota
Display the uptime of the server
Code:
uptime
Display the operating system stats
Code:
uname -a
Display your info
Code:
whoami
Display other users connected to the server
Code:
who
Display the last login
Code:
last
Tell where a file is located
Code:
whereis file
Check your email
Code:
mail
Display processes you're running
Code:
ps -x
Display all processes running
Code:
ps -a
Display running processes, with CPU/Memory usage
Code:
ps -ux
Kill a process
Code:
kill pid
Kill an eggdrop process
Code:
kill -9 pid
Kill all running process of the same type
Code:
killall program
Description of a command
Code:
whatis command
Display help on the command
Code:
man command
Report of the process list, 1 minute and 5 minute average load every 10 minutes since midnight server time
Code:
sar -q
Tars up the file or directory of your choice (Replace filename.tar.gz with the name you want your tar file to have, with the tar.gz extension on the end and replace file with the file or directory you want to tar up)
Code:
tar -zcf filename.tar.gz file
Update the locate/search DB
Code:
updatedb

vblts.ru supports vBulletin®, 2022-2024