Show Menu
Cheatography

Basic Linux Cheat Sheet (DRAFT) by

This cheat-sheet is for field worker and MNT team.

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Directory Management

mkdir
To create a Directory
rmdir
To remove a Directory
cd
To Change a Directory
cd ..
To go one Directory back
pwd
Print name of curren­t/w­orking directory
cd Documents/
To change the directory to Documents

ls (list files) Options

ls
To see content of the current dir
ls -al
To see all files of the current dir
ls -htl
List content with human readable size formate and sort by modifi­cation time, newest first

cp (Copy Command)

cp file1 /path/­Des­tin­ation
To copy a content to another Directory
cp -r file2/ /path/­Des­tin­ation
To copy a Directory

mv (Move Command)

mv [options] <so­urc­e> <de­sti­nat­ion>
Syntax
mv Dir1 <../­De­sti­nat­ion>
To move a file/D­ire­ctory from one place to anothe place
 

Compre­ssing Commands

tar -cvzf Codeba­se.t­ar.gz
To archive Codebase Dir to the Codeba­se.t­ar.gz formate
tar -cvjf Codeba­se.t­ar.bz2
To archive Codebase Dir to the Codeba­se.t­ar.bz2 formate
tar -xvf Codeba­se.t­ar.bz2
To extract the any formate of tar file.

Networking Commands

netscan
To see all IP's and MAC addresses on the Network
ssh -X userna­me@­IP_­address
To remotely acess the another machine on the network
scp Codeba­se.t­ar.bz2 userna­me@­IP_­add­res­s:/­hom­e/r­ov/­Dow­nloads
To copy a file local machine to remote machine.
scp -r userna­me@­IP_­add­res­s:/­hom­e/r­ov/­Dow­nloads
To copy a Directory from remote machine to local machine

Process Management

pidof <Pr­oce­ss_­Nam­e>
Syntax
pidof node
To know to the process id of the process name
top
To see real time process
sudo kill -9 <PI­D>
To kill the PID of the specified Process
sudo killall proces­s_name
To kill all the process related to this name