Commands by renich (9)

  • This command uses the reachable_host as a proxy; redirecting your request to the unreachable_host. The main advantage is that you need only one ssh key. You copy the public part to both servers and you can access the unreachable_host without a problem. Also, you can put this on ~/.ssh/config to access the unreachable_host directly: # config unreachable_host ProxyCommand ssh user@reachable_host -W %h:%p and, then, just ssh user@unreachable_host.


    4
    ssh -o "ProxyCommand ssh user@reachable_host -W %h:%p" user@unreacheable_host
    renich · 2015-06-26 06:23:14 2
  • This command uses -newerXY to show you the files that are modified since a specific date. I recommend looking for "-newerXY" on the manpage to get the specifics.


    3
    find /path/to/somewhere -newermt "Jan 1"
    renich · 2014-02-02 18:02:07 0
  • It clears caches from memory. It works fine on CentOS and Fedora. It will show you how much memory you need, for real.


    -4
    sync; echo 3 > /proc/sys/vm/drop_caches
    renich · 2011-04-26 21:12:06 0
  • This is not recommended... lossy -> lossy = lossier. Still, you can do it! ;)


    0
    find . -iname '*.mp3' | while read song; do mpg321 ${song} -w - | oggenc -q 9 -o ${song%.mp3}.ogg -; done
    renich · 2010-03-14 11:34:35 0
  • 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 Sample Output


    8
    find /path/to/images -name '*.JPG' -exec rename "s/.JPG/.jpg/g" \{\} \;
    renich · 2010-01-02 19:12:37 5
  • Nice interface for an info page.


    1
    yelp info:foo
    renich · 2009-03-29 07:14:48 2
  • A great way of viewing some man page while using gnome.


    2
    yelp man:foo
    renich · 2009-03-29 07:13:44 3
  • A great password generation tool. http://www.adel.nursat.kz/apg/ Show Sample Output


    3
    apg -a 0 -n 10
    renich · 2009-03-28 08:52:59 4
  • This command is a powerful "detoxifier" that eliminates special chars, spaces and all those little chars we don't like. It support several "sequences" so be sure to check your /usr/local/etc/detoxrc while at it... and maybe define your own Show Sample Output


    16
    detox -r -s utf_8 /path/to/old/win/files/dir
    renich · 2009-03-16 07:50:36 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

Compare a remote file with a local file
A little messy, but functional. Requires vim >= 7.x.

Labyrinth pattern
Generates labyrinth-like pattern on UTF-8 terminal in bash. For fun ;)

Create a simple video contact sheet using the vcs bash script
Assumes you've downloaded Toni Corvera's vcs script (http://p.outlyer.net/vcs), have it in your PATH, and have installed the script's dependencies. Generates a video contact sheet of 24 thumbnails and 3 thumbnails per column. The bold font and white-on-black color scheme keeps the text readable at the chosen 70% JPEG compression quality, which keeps the file size at a manageable level. You can go even lower with the quality and get a good looking result.

sort lines by length
making it "sound" more "natural" language like -- additionally sorting the longest words alphabetically: this approach is using: * to get at all lines of input * post-"for" structure * short-circuit-or in sort: if the lengths are the same, then sort alphabetically otherwise don't even evaluate the right hand side of the or * -C sets all input and ouput channels to utf8

Find usb device
I often use it to find recently added ou removed device, or using find in /dev, or anything similar. Just run the command, plug the device, and wait to see him and only him

vim read stdin

Search through files, ignoring .svn
By putting the "-not \( -name .svn -prune \)" in the very front of the "find" command, you eliminate the .svn directories in your find command itself. No need to grep them out. You can even create an alias for this command: $ alias svn_find="find . -not \( -name .svn -prune \)" Now you can do things like $ svn_find -mtime -3

resume download using curl

Find Duplicate Files (based on size first, then MD5 hash)
This dup finder saves time by comparing size first, then md5sum, it doesn't delete anything, just lists them.

convert pdf to graphic file format (jpg , png , tiff ... )
need imagemagick package


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: