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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
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:
%qdbus org.freedesktop.PowerManagement /org/kde/Solid/PowerManagement suspendToRam
Service 'org.freedesktop.PowerManagement' does not exist.
Starts a new shell (in bash/sh, it starts bash/sh). 'man bash' explains:
"If arguments remain after option processing, and neither the -c nor the -s option has been supplied, the first argument is assumed to be the name of a file containing shell commands. If bash is invoked in this fashion, $0 is set to the name of the file, and the positional parameters are set to the remaining arguments."
Some computers these days don't have an HDD activity light, but they still have a useless caps-lock, so why not re-purpose that light to show HDD activity?
Requires setleds and dstat and probably needs to run as root.
I was using some twitter bots and twitter bloks my IP. Now im using some proxys and i use these command to validate the tweet was published.
If the HISTTIMEFORMAT is set, the time stamp information associated with each history entry is written to the history file, marked with the history comment character.
Be careful, first run:
lsof | grep -i deleted | grep REG | grep -v txt
Then, give it the boot!
This command is almost the same as 'ls -a', but it does not display the current dir (.) or parent (..)
Gnu grep allows to restrict the search to files only matching a given pattern. It also allows to exclude files.
Appropriate for today.
Assuming we have a disk image, created by dd if=/dev/sda of=image.dd we can check the image's partition layout with fdisk -ul image.dd, then substitute "x" with starting sector of the partition we want to mount. This example assumes that the disk uses 512Byte sectors
If you used to do `vlc /tmp/Flash*`, but no longer can't, this is for you.
Neat idea! This variation works on FreeBSD.
Ctrl+L just rolls up your screen. Try Ctrl+Shift+X if you dont want to get confused between what was before on the screen, and what would be there when you run the next command
as alternative to cd $OLDPWD
When you need a quick ref guide while troubleshooting Apache|NGINX error|access logs.
Description by segments delimited by pipe (|)
1. List all git branches
2. Exclude master
3. Trim output and remove display elements such as * next to current branch
4. Repeat branch name after a space (output on each line: branch_name branch_name)
5. Prepend each line with the git tag command
6. Execute the output with bash
Useful to archive files once a day:
cp file file.$(date --iso)