Tips tagged awk


5

Tip #182   MAC address conversion

Convert mac addresses such as 000000abde00 into 00:00:00:ab:de:00

awk '{for(i=10;i>=2;i-=2)$0=substr($0,1,i)":"substr($0,i+1);print}' macaddress_list
sed 's/\(..\)/\1:/g;s/:$//' macaddress_list

// sil at infiltrated.net
Read more »

20

Tip #173   Count files by type

To find out the number of files of each type in your current directory try the following:

Read more »

7

Tip #170   SVN resolve all conflicts

Resolve all your conflicted files. Use with caution!!

Read more »

6

Tip #27  

Use awk to change the file extension for a group of files. For example to change all .htm files to .php:

Read more »

12

Tip #92   Sort a file by line length

Sort a file by line length:

Read more »

4

Tip #48   Check low space

Mail somebody about space running low in some path (ksh, bash):

Read more »