Commands by leovailati (5)

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

check open ports without netstat or lsof

currently mounted filesystems in nice layout
since fuse mounts do not appear in /etc/mtab (fuse can't write there, dunno if it would if it could) this is propably a better way.

Find recursively, from current directory down, files and directories whose names contain single or multiple whitespaces and replace each such occurrence with a single underscore.
Note the g for global in the perl expression; without it, only the first occurrence in the name would be replaced.

Create several copies of a file
Copy a file to a range of other files.

Display a random man page
I'm not sure why you would want to do this, but this seems a lot simpler (easier to understand) than the version someone submitted using awk.

Remount root in read-write mode.
Saved my day, when my harddrive got stuck in read-only mode.

Edit your command in vim ex mode by <ctrl-f>
If you are in ex mode in vim i.e. you've pressed ':'. You can edit the current command by pressing <ctrl-f>

Quick and dirty RSS
runs an rss feed through sed replacing the closing tags with newlines and the opening tags with white space making it readable.

Change user, assume environment, stay in current dir
I've used this a number of times troubleshooting user permissions. Instead of just 'su - user' you can throw another hyphen and stay in the original directory.

clean up syntax and de-obfuscate perl script
the command show can be run in vim, here is the same thing on the command line $ cat script.pl | perl -MO=Deparse | perltidy


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: