Unix Basic Commands
Unix Basic Commands
Unix Basic Commands
ls: listing
Ps tree: list of process running since long time and memory usage.
777-All Permissions
1-Execute
2-Write
3-Execute/Write
4-Read
5-Read/Execute
6-Read/Write
7-Read/Write/Execute
CAT command:
CAT > filename: we can enter the values into the file
CAT >> filename: values entered into the file can be edited (only at the end of the
file)
Vi editor: Using vi editor also we can edit the values (here we can edit anywhere –
Beginning, Middle or end of the file)
$ cut -f n filename (in place of n you need to mention the number of the column
you want)
unix or linux os
is unix good os
is linux good os
The cut command can be used to print characters in a line by specifying the
position of the characters. To print the characters in a line, use the -c option in
cut command
OUTPUT:
cut -c4 file.txt
xo
ui
ln
This command prints the fourth and sixth character in each line.
tr --- translator
tr ‘a-z’ ‘A-Z’ <filename --- small letters will be replaced into CAPITAL LETTERS
SED -n ‘11p – 19p’ filename this gives the rows from 11 to 19 (Here p is the
parameter)
GREP Command --It is a search option for WORDS (grep -n ‘word’ filename)
AND
In this case if you mention i it ignores case sensitive and gives all the 50k values (it
will have both 50k and 50K).
Grep ‘is’ filename – we will get all the records which has the word ‘is’ from that
particular file
Grep ‘rahul’ * ----- we will get all the records which has rahul from all the files.
Cal | (pipe symbol) tee filename ----Here it gives the result and copies the data
to another file.
Points to Remember