Basic Linux Commands
Basic Linux Commands
1. nano editor:
2. vi editor:
i – insert mode
Esc – command mode
: - command line mode
:w – save file
:q – Quit
:wq or ZZ – save and quit
:q! – force quit without saving
dd – delete current line
yy – copy current line
p – for paste
u – undo last changes
I – insert beginning of the line
Shift+g – To go top to bottom of the page
gg – to go bottom to top of the page
/ - use to search top to bottom
? – use to search bottom to top
:earlier 10M – To show 10 minutes before file condition
:%s/old/new/g – replace old value to new value
:s/old/new/ - replace on current line
:set number – to show line number
:set nonumber – hide line number
:e! – to revert old position of file but mandatory its not be save.
Shift+P – to paste one line upper.
Shift+v – to select any word
Shift +o – to new line
Shift +i – to use to front of any word of any line
Shift +a – to use show last word of any line .
vim filename – to create new file
Esc+:+syntaxOff – to remove color of vi editor mode
Esc+:+syntaxOn – to on color of vi editor mode
vim – o file1 file2 – to work two file in same time .
ctrl + w press two times – to reach second file and go to first file
press same ctrl +w two times.
cp file1 file2 – copy file1 into file2
vim –d file1 file2 – to find two files.
INODE :
Linux must allocate an index node (inode) for every file and directory
in the filesystem. Inodes do not store actual data. Instead, they store
the metadata where you can find the storage blocks of each file's
data.
Metadata in an inode:
Filetype , permission ,ownerid ,groupid ,filesize ,timestamp, lasttime access,
Last time modified .(filename,filepath not stored)
ls-li – to check inode .
df- i – to check how many inode used.
Size of inode is 2048 bytes or 2 kilobytes.