commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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.
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:
Wow, didn't really expect you to read this far down. The latest iteration of the site is in open beta. It's a gentle open beta-- not in prime-time just yet. It's being hosted over at UpGuard (link) and you are more than welcome to give it a shot. Couple things:
Manages everything through one sed script instead of pipes of greps and awks. Quoting of shell variables is generally easier within a sed script.
THIS COMMAND IS DESTRUCTIVE. That said, lets assume you want to render your boot drive unbootable and reboot your machine. Maybe you want it to boot off the network and kickstart from a boot server for a fresh OS install. Replace /dev/fd0 with the device name of your boot drive and this DESTRUCTIVE command will render your drive unbootable. Your BIOS boot priority should be set to boot from HD first, then LAN.
I wanted to keep a backup of my company database server on my local homeserver. After I found maatkit to sync databases, everything except security seemed fine. SSH takes care of that part.
shows also time if its the same year or shows year if installed before actual year and also works if /etc is a link (mac os)
Have wc work on each file then add up the total with awk; get a 43% speed increase on RHEL over using "-exec cat|wc -l" and a 67% increase on my Ubuntu laptop (this is with 10MB of data in 767 files).
One pipe less.
Every seconds do
Based on the MrMerry one, just add some visuals to differentiate files and directories
An NCurses version of the famous old 'du' unix command
Based on the MrMerry one, just add some visuals and sort directory and files
To highlight the difference between screen updates
If you need to keep an eye on a command whose output is changing, use the watch command. For example, to keep an eye on your load average
If you launch gnome-terminal manually, you can start with three open tabs
checkfor: have the shell check anything you're waiting for.
'while : ; do' is an infinite loop
'$*' executes the command passed in
'sleep 5' - change for your tastes, sleep for 5 seconds
bash, ksh, likely sh, maybe zsh
Ctrl-c to break the loop
For example: check the APT security keys to make sure the Google digital signature was imported correctly
You can view the man pages from section five by passing the section number as an argument to the man command
fcd : file change directory
A bash function that takes a fully qualified file path and cd's into the directory where it lives. Useful on the commadline when you have a file name in a variable and you'd like to cd to the directory to RCS check it in or look at other files associated with it.
Will run on any ksh, bash, likely sh, maybe zsh.
Make sure that find does not touch anything other than regular files, and handles non-standard characters in filenames while passing to xargs.
Sends both stdout and stderr to the pipe which captures the data in the file 'out.test' and sends to stdout of tee (likely /dev/tty unless redirected). Works on Bourne, Korn and Bash shells.
needs no GNU tools, as far as I see it