Commands tagged vim (143)

What's this? 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 IP octets to HEX with no dots.
Converts IP octets to hex using printf command. Useful for generating pxeboot aliases in the pxelinux.cfg folder.

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

List only executables installed by a debian package
Safe for whitespaces in names.

Edit a file inside a compressed archive without extracting it
If you vim a compressed file it will list all archive content, then you can pickup any of them for editing and saving. There you have the modified archive without any extra step. It supports many file types such as tar.gz, tgz, zip, etc.

List files size sorted and print total size in a human readable format without sort, awk and other commands.

Encryption file in commad line
This will encrypt your single file and create a filename.gpg file. Option: * -c : Encrypt with symmetric cipher To decrypt dhinesh@ubuntu:~$ gpg -c sample.rb.gpg

Cleanup a (source) text file, removing trailing spaces/tabs and multiple consecutive blank lines
I used this command (in addition to a code formatting tool) to "cleanup" a bunch of PHP files

Recursively remove .svn directories from the current location

Download Youtube video with wget!
Nothing special required, just wget, sed & tr!

Keep a copy of the raw Youtube FLV,MP4,etc stored in /tmp/
Certain Flash video players (e.g. Youtube) write their video streams to disk in /tmp/ , but the files are unlinked. i.e. the player creates the file and then immediately deletes the filename (unlinking files in this way makes it hard to find them, and/or ensures their cleanup if the browser or plugin should crash etc.) But as long as the flash plugin's process runs, a file descriptor remains in its /proc/ hierarchy, from which we (and the player) still have access to the file. The method above worked nicely for me when I had 50 tabs open with Youtube videos and didn't want to have to re-download them all with some tool.

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.


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: