SOME BASIC LINUX COMMANDS...


 

FILES & NAVIGATING 

Is - directory listing (list all files/folders on current dir) Is -| - formatted listing 
Is -la - formatted listing including hidden files
cd dir - change directory to dir (dir will be directory name)
cd. - change to parent directory 
cd-/dir - change to dir in parent directory
cd - change to home directory 
pwd - show current diroctory 
mkdir dir - create a directory dir 
rm file - delete file
rm-f dir - force remove file 
rm-r dir - delete directory dir 
rm-rf dir - remove directory dir 
rm-rt/- launch some neuclear bombs targeting your system 
cp filel file2 - copy filel to file2
 mv filel file2 - rename filel to file2 
mv filel dir/file2 - move filel to dir as file2
 touch file - create or update file 
cat file - output contents of file 
cat > file - write standard input into file 
cat >> file - append standard input into file
 tail -f file - output contents of file as it grows

SYSTEM  INFO

date - show current date/time
 uptime - show uptime
 whoami - who you're logged in as
 w - display who is online
 cat /proc/cpuinfo - display cpu info 
cat /proc/meminfo - memory info
 free - show memory and swap usage 
du - show directory space usage
 du-sh - displays readable sizes in GB 
df - show disk usage
 uname -a - show karnel config

NETWORKING

ping host - ping host 
whois domain - got whois for domain 
dig domain - get DNS for domain
 dig-x host - reserve lookup host 
wget file - download file
 wget -c file continue stopped download
 wget -r url - recurively download files from url 
curl url - outputs the webpage from url 
curl-o meh.html url - writes the page to meh.html
 ssh usar@host - connect to host as user
 ssh-p port user@host - connect using port 
ssh -D user@host - connect & use bind port

PROCESSES

ps - display currently active processes 
ps aux - detailed outputs 
kill pid - kill process with process id (pid)
killall proc - kill all processes named proc

COMPRESSING

tar of file.tar files - tar files into file.tar
tar xf file.tar - untar into current directory
tar tf file.tar - show contents of archive

 options:

c - create archive                          j - bzip2 compression
t - table of contents                      w - ask for confirmation
x - extract                                    k - do not overwrite 
z - use zip/gzip                            T- files from file
f - specify filename                      v - verbose

PERMISSIONS

chmod octal file - change permissions of file 

4 - read (r) 
2 - writw(w)
1- execute (x) 
order; owner/graup/world 
chmod 777 - rwx for everyone 
chmod 755 - rw for owner, rx for group world

SOME OTHERS

grep pattern files - search in files for pattern 
grep -r pattern dir - search for pattern recursively in dir
locate file - find all instances of file 
whereis app - show possible localtions of app 
man command - show manual page for command


Popular Posts