Tuesday, 21 January 2014

Basic Linux Commands

Commands in linux
Command
Meaning
ls
Will list the items in files
ll
Will list the items vertically
cat
Will help to read the file mentioned in command.
cd ..
Will one directory back
diff
print line difference in files. Not the entire string
grep
grep 'abc ' /chitrank/txt . Search abc text in txt files
grep -v
grep -v 'abc' /chitrank/txt . Not condition of above grep
grep -i
ingnore case
grep -w
to search on given word
cat /chitrank/input/*  | grep -i 'a'
Grep commands with pipe
cat /chitrank/input/*  | grep -l 'a'
to list the file with given word
grep --color 'a'
Will show matches in color
mkdir
will make directory
cd /folder/file
will move to that file directory
awk
find or replace text
chmod
change the access of files or directory // fullacess chmod ug+rwx file.txt  // revoke chmod g-rwx file.txt // give access chmod -R ug+rwx file.txt
chown
change user and group ownership
adduser
add a new user
echo
display message on console
cnp
comapre two files
mv
move file
passwd
modify user password
pwd
print working dir
tar
to
useradd
add new user account
nano
to open editor and make files
sort
to sort file
unzip
unzip a flie
top
find the programs running
kill
kill a task
man
diplays main page
tail
print last lines in file
less
prints less number of outputs
su
switch to other user. Root can switch widout password
yum
to install apche using yum
rpm
to install apche using rpm
date
prints date
get
get file from other loc
put
put file to other loc
find
find files using file name
ssh
remote accesss
cut
cut some part from files
tr
replaces some pattern and changes file output format // tr -s '|' ',' < Ret_MediaTP | cut -f1-28 -d, > MediaTp__Ret.txt
To find File name
find . -type f -printf "%f\n" > /home/hduser1/chitrank/freshseq


No comments:

Post a Comment