Commands using awk (1,418)

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

Trace a DNS query from root to the authoritive servers.
Simple command to trace a DNS query from the root all the way to the authoritative servers.

Directory Tree
tree has lots of parms - man is your friend

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

rsync instead of scp
The command copies a file from remote SSH host on port 8322 with bandwidth limit 100KB/sec; --progress shows a progress bar --partial turns partial download on; thus, you can resume the process if something goes wrong --bwlimit limits bandwidth by specified KB/sec --ipv4 selects IPv4 as preferred I find it useful to create the following alias: alias myscp='rsync --progress --partial --rsh="ssh -p 8322" --bwlimit=100 --ipv4' in ~/.bash_aliases, ~/.bash_profile, ~/.bash_login or ~/.bashrc where appropriate.

Uninstall bloatware on your android device without root.
List all packages with: pm list packages|cut -d: -f2

ssh -A user@somehost
the -A argument forwards your ssh private keys to the host you're going to. Useful in some scenarios where you have to hop to one server, and then login to another using a private key.

rot13 simple substitution cipher via command line
E.g. Useful for hiding spoilers in reviews, etc.

Get a funny one-liner from www.onelinerz.net
Put this command in .bashrc and every time you open a new terminal a random quote will be downloaded and printed from onelinerz.net. By altering the URL in the w3m statement you can change the output: 1 to 10 lines - http://www.onelinerz.net/random-one-liners/(number)/ 20 newest lines - http://www.onelinerz.net/latest-one-liners/ Top 10 lines - http://www.onelinerz.net/top-100-funny-one-liners/ Top 10 lines are updated daily.

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Remove BOM (Byte Order Mark) from text file
Takes file (text.txt), removes BOM from it, and outputs the result to a new file (newFile.txt). BOM is "Byte Order Mark" ([http://en.wikipedia.org/wiki/Byte_order_mark]), an invisible, non-breaking, zero-length character. In other words, if you see a DIFF with "" at the beginning, you've got a byte order mark, which can't be removed without this command or a hex editor. It can appear for a number of reasons, such as getting copied to/from a UNIX filesystem...


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: