Basic unix commands for daily use

delete :-   rm -rf
copy :- cp -r source destination
move :- mv


check ip name from console:  ifconfig -a

to go back one directory :-  cd  ..
back 2 directory :-   cd ../..

to see logs:-
tail -n 100 filepath
cat  filepath
less ( both side scrolling) & more ( one side scrolling)  / for next occurrence ? for previous



to see process:-
ptree
ps -ef|grep "process name"

 
To Find a file in unix dir
find . -name "pattern" -print


vi editor
changes between modes :  Esc and i for command and insertion mode respectively
delete character and line:  
x :- right  characters
X :- left characters
dd :- current line  
D :- delete upton end of line
/string :-Search forward for string
?string :-Search backword for string

n and N for next and previous instance of string


remove a file rm <filename>
remove a directory rm -rf  --<dirname>

copy filename : cp tempfile tempfile_amit
copy entire directory:  cp -R temp temp_amit

Comments

Popular posts from this blog

Conversion from Clob To String in java and Vice versa

Portable Java 8/ JDK8 setup without admin rights

Multi Threading , Producer consumer problem in Java