Commands by karakral (0)

  • bash: commands not found

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

Replaces a color in a PDF document, useful for removing a dark background before printing.
The pdf is first converted to a bitmap, so change "-density" to match your printer resolution. Also be careful about the RAM required. In this example rgb(0,0,0) is replaced by rgb(255,255,255), change to suit your needs.

Ask user to confirm
Returns true if user presses the key. Use it like $ Confirm "Continue" && do action

List files with full path
Prints contents of current directory with the full path prepended to each entry. You can add '-type f' if you don't want the directories to show up (for those less familiar with find). I can't believe ls doesn't have an option for this.

get a desktop notification from the terminal
tired of switching to the console to check if some command has finished yet? if notify-send does not work on your box try this one... e.g. rsync -av -e /usr/bin/lsh $HOME slowconnection.bar:/mnt/backup ; z (now fire up X, do something useful, get notified if this stuff has finished).

Join a folder full of split files
If you use newsgroups then you'll have come across split files before. Joining together a whole batch of them can be a pain so this will do the whole folder in one.

Make .bashrc function to backup the data you changed last houres
The original overwrites any previous backups, and only saves exactly the last hours worth, but not 1 hour + 1 minute. This version creates or appends files, and backs up everything since the last backup (using the backups timestamp as the reference), plus it uses TMPDIR if set.

Create a thumbnail from a video file

Grep log between range of minutes
Returns logs between HH:M[Mx-My], for example, between 13:40 and 13:45.

find large files
simple find -> xargs sort of thing that I get a lot of use out of. Helps find huge files and gives an example of how to use xargs to deal with them. Tested on OSX snow leopard (10.6). Enjoy.

type partial command, kill this command, check something you forgot, yank the command, resume typing.
Example : $ vim /etc/fstab ## damn $ $ sudo ## like a boss. Example 2 : $ sudo vim /root/bin/ ##uh... autocomplete doesn't work... $ $ sudo ls /root/bin ##ah! that's the name of the file! $ sudo vim /root/bin/ ##resume here! Thanks readline!


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: