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:
Many tasks need mac id check. above command exactly do the same
This removes the video and subsequent file size and directly copies the audio.
-x, --extract, --get
extract files from an archive
-p, --preserve-permissions, --same-permissions
extract information about file permissions (default for superuser)
use archive file or device ARCHIVE
verbosely list files processed
-t, --tuples-only print rows only
Same as the other rtfm's, but using the more correct xdg-open instead of $BROWSER.
I can't find a way to open info only if the term exists, so it stays out of my version.
This command solve the problem ping: sendmsg: No buffer space available to.
There is no longer a need to add PGP keys for Ubuntu Launchpad PPA's.
The add-apt-repository command creates a new file for the PPA in /etc/sources.list.d/ then adds the PPA's keys to the apt keyring automatically. No muss, no fuss.
Convert all .weblock files (Apple url) to a url on the stdout.
If we've many files containing (?, ?, ?, ?, ? ) characters instead of ?, ?,... etc,...
we can ue this simple command line running a sed command inside a for loop searching for files containing that characters.
Hope u like it! Enjoy! ;)
The sed script ensures that the "random" MAC address is unicast (bit 0 of first byte == 0) and local (bit 1 of first byte == 1)
In this example I am returning all the files in /usr/bin that weren't put there by pacman, so that they can be moved to /usr/local/bin where they (most likely) belong.
Shows a tree of the disks. Requires "tree"
For a given filesystem return the LUN ID. Command assumes 1:1 relationship between fs:lv:hdisk:lun which may not be the case in all environments.
Add date time to output whithin the current directory
Show the current load of the CPU as a percentage.
Read the load from /proc/loadavg and convert it using sed:
Strip everything after the first whitespace:
sed -e 's/ .*//'
Delete the decimal point:
sed -e 's/\.//'
Remove leading zeroes:
sed -e 's/^0*//'
This version is precise and requires one second to collect statistics. Check sample output for a more generic version and also a remote computer invocation variant. It doesn't work with the busybox version of the 'top' command but can be adjusted
Doesn't create a file
Make sure to list the files / directories in the same order every time.