Basic Shell Commands

From BlueFur.com Support Wiki

Jump to: navigation, search

Here is a list of some basic shell commands:

cd /home/ 
Will change directory to the /home directory
top 
This shows basic information such as uptime, CPU usage, memory usage and processes running
ls 
Lists all files in a directory
ls -al 
Lists all files plus hidden files
ps aux 
Shows all processes running
netstat -natp 
Shows all active TCP connections to your server
netstat -naup 
Shows all active UDP connections to your server
tail filename 
Shows the end contents of a file, good for viewing last entries to log files
who 
Shows who is logged into shell
last 
Shows a list of all accesses to the server ftp and shell
pwd 
shows your current position in the filesystem
locate expression 
Will find all files named with 'expression'
locate expression | more 
Will find all files named with 'expression', only gives you a few results at a time, press enter for more
find . -type f -exec fgrep -li happy {} ; 
Will list all files in the current directory that contain the word 'happy'
chown username.group file.txt 
Will change the ownership of file.txt to user 'username and group 'group'
chmod 755 file.cgi 
Will change the permissions on file.cgi
cp file.txt file2.txt 
Copies file.txt to file2.txt
rm file.txt 
Deletes file.txt
pico /home/user/file.php 
Edit or, if it doesn't already exist, create the file 'file.php'
exit 
Logs you out of shell
Personal tools