You are on page 1of 3

Commands Meaning

pwd to know the location


ls to show files in current folder
ls -lrt to show files in current folder with details
mkdir to make new folder
rmdir to delete folder
cd /path to go into a folder
cd .. for back folder
rm filename to remove file
cp filename /path to copy file in a folder
touch to create a file
mv to move a file or rename a file
locate to find the location
df to know the space in each disk space
zip to compress file into zip
unzip to extract files from zip
hostname to know your name in your host or network
ping to check connection to a server
^insert to copy selected keyword
right click to paste selected keyword
grep to search a specific pattern
find to search file in a directory or sub directory
SCP scp -r filename.ext a.b.c.d:/root/path/path
rm -r to delete folder including all files after confirmation of each files
rm -rf to delete folder including all files without any confirmation
grep grep 'name' filename.ext
yy to copy the complete line
nyy to copy the n number of lines
p to paste the copied line after the cursor
P to paste the copied line before the cursor
to copy file from one server to another server

to get content from any file


Commands Meaning
vi to open and edit file (vi filename)
vi -r filename recover filename that wasbeing edited when system crashed
:q to close a file
:q! to close a file without saving
:wq! to close file after saving
:0 or 1G move cursor to first line in file
:n or nG move cursor to line n
:$ or G move cursor to last line in file
*x delete single character under cursor
*dd delete entire current line
j move cursor down one line
k move cursor up one line
h move cursor left one character
l move cursor right one character
0 (zero) move cursor to start of current line
$ move cursor to end of current line
w move cursor to beginning of the next word
b move cursor back to beginning of thr precdeding word
:set ic to search case sensitive keywords

You might also like