awk: Find and Replace text

On August 28, 2009, in awk, find, replace, Text, by Dipin Krishna

Syntax awk <options> ‘Program’ Input-File1 Input-File2 … awk -f PROGRAM-FILE <options> Input-File1 Input-File2 … If no Input-File is specified then `awk’ applies the Program to “standard input”, (piped output of some other command or the terminal. Typed input will continue until end-of-file (typing `Control-d’) Basic functions The basic function of awk is to search files […]


Common UNIX Find Commands

On November 19, 2008, in commands, Common, find, UNIX, Using, by Dipin Krishna

One of the most useful utilities in the UNIX systems resources directory is the find command. System administrators use this powerful utility frequently. Here are a few common tasks performed by the ubiquitous find command. I’ll add more as time goes on. # cd /export/home/esofthub Find a file or directory# find . -name TEMP -printor# […]


Howto find Disk usage of Packages in ubuntu

On November 12, 2008, in Disk usage, find, Howto, packages, ubuntu, by Dipin Krishna

The following command help you to find the disk space used by different packages in ubuntu open a terminal window and run the commanddpkg-query –show –showformat=’${Package;-50}\t${Installed-Size}\n’ | sort -k 2 -n | grep -v deinstall | awk ‘{printf “%.3f MB \t %s\n”, $2/(1024), $1}’ That will sort the packages by size, putting the largest ones […]