Commands tagged logs (9)

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

Fast search in man files or bz-files by keyword direct by man or bz files
For example we need find fast where located and described keyword COMMIT_EDITMSG in man files. Here example howto solve it by search with command bzgrep in man files. Generally these files in bz compressed format. You can use another keywords to your search. Common syntax is: bzgrep -lE keyword1 /usr/share/man/man?/optional-keyword-to-refine* or bzgrep -lE keyword1 /usr/share/man/man?/* where optional-keyword-to-refine is optional and may be omitted but used to speedup search Of course you may combine other options for bzgrep (its based on grep)

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }

Force unmount occupied partition
Alternative if "Lazy unmount" (umount -l) doesn't obey. Alternative for NFS: $ umount -f /media/sdb1 Use with caution: forcing to unmount a busy partition can cause data loss!

Increment the filename of png in a given directory by one

Create colorized html file from Vim or Vimdiff
While editing a source file in vim, or using vimdiff to compare two or more files, the ':TOhtml' command can be used to export each buffer as an html file, including syntax highlighting and vimdiff colorization. If you are in insert mode in vim, you will have to type :TOhtml This will open a new buffer filled with html, which you can then save.

Rename .JPG to .jpg recursively
This command is useful for renaming a clipart, pic gallery or your photo collection. It will only change the big caps to small ones (on the extension).

Show Shared Library Mappings
shows which shared lib files are pointed to by the dynamic linker.

ssh tunnel with auto reconnect ability

Remove CR LF from a text file
Remove CR LF (CRLF) from a text file. use man:tr to get more info about removing other characters from a file. and even character to character replacements.

List processes sorted by CPU usage

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: