important commands

cut,sort,uniq.sed.awk commands

[root@rhel6-client1 ~]# cat cutcommand 
hello now we are gojng to explain cut command
this is the first line of our practise
seond line of our practise session
third line will be this
fourth line  consists of this data
like this we can practise

[root@rhel6-client1 ~]# cut -d ” ” -f1 cutcommand
hello
this
seond
third
fourth
like

[root@rhel6-client1 ~]# cut -d ” ” -f2 cutcommand 
now
is
line
line
line
this
[root@rhel6-client1 ~]# cut -d” ” -f1,6 cutcommand
hello to
this of
seond session
third
fourth this
like

[root@rhel6-client1 ~]# cut -c1 cutcommand 
h
t
s
t
f
l
[root@rhel6-client1 ~]# cut -c1-9 cutcommand 
hello now
this is t
seond lin
third lin
fourth li
like this
[root@rhel6-client1 ~]# cut -c-3 cutcommand 
hel
thi
seo
thi
fou
lik
[root@rhel6-client1 ~]# cut -c-3 cutcommand | sort
fou
hel
lik
seo
thi
thi
———————————————————————————————————–

sed [options] commands [file-to-edit]

Leave a comment