Commands by aikikode (2)

  • This command will allow to search for duplicate processes and sort them by their run count. Note that if there are same processes run by different users you'll see only one user in the result line, so you'll need to do: ps aux | grep <process> to see all users that run this command. Show Sample Output


    2
    ps aux | sort --key=11 | uniq -c -d --skip-fields=10 | sort -nr --key=1,1
    aikikode · 2011-07-19 07:11:29 76
  • After executing a command with multiple arguments like cp ./temp/test.sh ~/prog/ifdown.sh you can paste any argument of the previous command to the console, like ls -l ALT+1+. is equivalent to ls -l ./temp/test.sh ALT+0+. stands for command itself ('ls' in this case) Simple ALT+. cycles through last arguments of previous commands.


    13
    <ALT>+<.> or <ALT>+<NUM>+<.> or <ALT>+<NUM>,<ALT>+<.>
    aikikode · 2011-03-01 17:41:08 4

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

convert flac to mp3
if you haven't already done so, install lame and flac: sudo apt-get install lame flac

Reset terminal that has been buggered by binary input or similar

Check for Firewall Blockage.
This is just one method of checking to see if an IP is blocked via IP tables or CSF. Simple and to the point. Replace xx.xx.xx.xx with the IP you wish to check.

Rename .JPG to .jpg recursively
Recursively rename .JPG to .jpg using standard find and mv. It's generally better to use a standard tool if doing so is not much more difficult.

Get IP from host
I just wanted a simple DNS request. Because host and nslookup commands are not on all systems, we use getent instead. Thanks aulem for that tip.

list block devices
Shows all block devices in a tree with descruptions of what they are.

convert UNIX timestamp to UTC timestamp
date -ud @1320198157

Uptime in minute

Randomize lines in a file
shuf is in the coreutils package

get all pdf and zips from a website using wget
If the site uses https, use: $ wget --reject html,htm --accept pdf,zip -rl1 --no-check-certificate https-url


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: