Commands tagged whitespace (3)

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

Get all URLs from webpage via Regular Expression
Get all URLs from website via Regular Expression... You must have lynx installed in your computer to execute the command. --> lynx --dump "" | egrep -o "" - Must substitute it for the website path that you want to extract the URLs - Regular Expression that you wanna filter the website

grep for minus (-) sign
Use flag "--" to stop switch parsing

Show current pathname in title of terminal
This helps to keep track of what is going on when you have several tabs open in your terminal. The title automatically changes when you change directories.

Remove all the files except abc in the directory
This is for zsh with extended globbing.

Find the package that installed a command

Backup a local drive into a file on the remote host via ssh

cd to (or operate on) a file across parallel directories
This is useful for quickly jumping around branches in a file system, or operating on a parellel file. This is tested in bash. cd to (substitute in PWD, a for b) where PWD is the bash environmental variable for the "working directory"

Outputs each arg on its own line
This can be useful for transforming command-line args into input for xargs (one per line). This can also be done with ls if the args are filenames, but that's getting awfully close to Useless Use of Cat territory (http://partmaps.org/era/unix/award.html).

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

Copy something to multiple SSH hosts with a Bash loop
Just a quick and simple one to demonstrate Bash For loop. Copies 'file' to multiple ssh hosts.


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: