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]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s