unix

1.replace doshi with desai

 .sed 's/doshi/desai/g' file.txt

2.display lines beginning with alphabets or digit from file x1

grep '[a-z A-Z 0-9]' file name

3.do not contain account

grep -v 'account' file.txt

 4.list name consist of only 4 digits

find . -name  "????"  -print

5.find files whoes 1 character is not special

find . -type  -f  -print | grep "[^a-z 0-9 A-Z]"

6.blank line between 10 to20 of a file

sed -n '10,20p' filename | grep '^$' 

7.display the lines on screen as well as save it to other file

grep '^[A-Z]*$' file.txt | tee filename

8.convert lowercase to uparcase

tr [a-z] [A-Z] filename


Comments