Commands by zb (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

Set a Reminder for yourself via the notification system
This will be seen through your system's visual notification system, notify-osd, notification-daemon, etc. --- sleep accepts s,m,h,d and floats (date; sleep .25m; date) --- notify-send (-t is in milliseconds && -u low / normal / critical) man notify-send for more information --- notification-daemon can use b/i/u/a HTML

know the current running shell (the true)
Return the current shell. It is better than print $SHELL which can sometimes return a false value.

Broadcast your shell thru UDP on port 5000
Better solution in case of many clients, imo.

Install a new kernel in Manjaro linux
00 is the number of the linux kernel e.g. linux39

dump the whole database

Get full from half remembered commands
Show all commands having the part known by you. Eg: $apropos pdf | less

find .txt files inside a directory and replace every occurrance of a word inside them via sed

Backup a remote database to your local filesystem
I have this on a daily cronjob to backup the commandlinefu.com database from NearlyFreeSpeech.net (awesome hosts by the way) to my local drive. Note that (on my Ubuntu system at least) you need to escape the % signs on the crontab.

repeat a command every one second
Short method of "while x=0; do foo ; sleep 1 ; done"

Recall last argument of previous command
!$ recalls the last argument of the previous command. This is very useful when you have to operate several operations on the same file for example.


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: