Monday, May 26th, 2008 11:16 PM
This will convert all the ico files in the folder to gif. It uses the final frame of the ico file to create the gif.
for i in *.ico; do convert `mogrify -identify $i|awk '{print $1}'|tail -n1` $i.gif; done
No Comments »
Sunday, April 27th, 2008 11:04 PM
This command removes all the even lines from the file given as the argument
cat example.txt|awk 'NR%2==1'
No Comments »
Wednesday, April 16th, 2008 11:17 PM
Use this command if you want to know your command usage stats in the fish shell.
grep -v "^\#" ".config/fish/fish_history"|awk '{print $1}'|sort|uniq -c|sort -rn|head -n10
No Comments »
Friday, September 14th, 2007 11:05 PM
A better way to get the process id of an application. I recommend giving an alias for this command…
ps aux|grep firefox|awk '{print $2 "\t\t" $12}'|head -n1
Replace firefox with the name of the application you are searching for.
[tags]linux,command,cli,awk,ps,process,id,grep[/tags]
No Comments »
Monday, July 9th, 2007 10:39 PM
One can use awk to get a specific column from a command output…
First column of the command
date|awk '{print $1}'
11th Column of the command
ps aux|awk '{print $11}'
Use a different Field separator
cat /etc/passwd|awk -F ':' '{print $1}'
[tags]awk,sed,shell,script,output,filter,text,cli,linux,string,separator[/tags]
No Comments »
Friday, May 11th, 2007 12:22 AM
Simple uses for awk
Get the second column from the output
ps aux | awk '{print $2}'
Use a different column separator
cat /etc/passwd|awk '{print $1}'
[tags]awk,cli,linux,command,filter,text[/tags]
No Comments »