0% found this document useful (0 votes)
48 views2 pages

AWK Commands

The document discusses the UNIX operating system, noting that it is an open source and free OS that is easy to learn. It provides examples of commands for the AWK and SED tools to manipulate text data files, including printing columns/fields and deleting/extracting lines. It also demonstrates the CUT command for selecting bytes, characters, or fields from each line of files.

Uploaded by

vasundhara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views2 pages

AWK Commands

The document discusses the UNIX operating system, noting that it is an open source and free OS that is easy to learn. It provides examples of commands for the AWK and SED tools to manipulate text data files, including printing columns/fields and deleting/extracting lines. It also demonstrates the CUT command for selecting bytes, characters, or fields from each line of files.

Uploaded by

vasundhara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

unix is great os. unix is opensource. unix is free os.

learn operating system.


unix linux which one you choose.
unix is easy to learn.unix is a multiuser os.Learn unix .unix is a powerful

AWK command :

awk -F '.' "{print $1}" new.dat

awk '{print $1}' new.dat

awk '{print $1}' new.dat


awk '{print $1,$2,$NF}' new.dat

sed -n '3p' new.dat

sed -i '1,3d' new.dat


sed -i '$d' new.dat

cut -c column operaion


cut -b byte operaion
cut -f filed operation
cut -d delimiter operaion

/disk2/home/avasundh> cut -b 1,2,3 new.dat


win
lea
lin
/disk2/home/avasundh> cut -b 1-3 new.dat
win
lea
lin
/disk2/home/avasundh> cut -b 1-3,10-13 new.dat
wins gr
learati
linnux
/disk2/home/avasundh> cut -b 1- new.dat
windows is great os. windows is opensource. windows is free linux.
learn operating system.
linux2 linux which one you choose.
/disk2/home/avasundh> cut -b -7 new.dat
windows
learn o
linux2
/disk2/home/avasundh> cut -d " " -f 3 new.dat
great
system.
which
/disk2/home/avasundh> cut -d "." -f 3 new.dat
windows is free linux
/disk2/home/avasundh> cut -d "." -f 3 new.dat >> xyz.dat
/disk2/home/avasundh> cat xyz.dat
windows is free linux

/disk2/home/avasundh> grep -v "^" xyz.dat


/disk2/home/avasundh> cat xyz.dat
windows is free linux

/disk2/home/avasundh> grep -v "^$" xyz.dat


windows is free linux
/disk2/home/avasundh>
/disk2/home/avasundh> cat xyz.dat >> new1.dat
/disk2/home/avasundh>
/disk2/home/avasundh> grep -v "^$" xyz.dat >> new1.dat
/disk2/home/avasundh> cat new1.dat
windows is free linux
/disk2/home/avasundh>

ancur sreevastava

You might also like