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.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
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:
Alternative1 (grep support):
pacman -Ss python | paste - - | grep --color=always -e '/python' | less -R
Alternative2 (eye-candy, no grep):
pacman --color=always -Ss "python" | paste - - | less -R
in ~/.bashrc:
pkg-grep() { pacman -Ss "$1" | paste - - | grep --color=always -e "${2:-$1}" | less -R ; }
pkg-search() { pacman --color=always -Ss "python" | paste - - | less -R; }
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.
-Qdt Lists dependencies/packages which are no longer required by any packages
-q Output only package name (not the version number)
-R Remove package(s)
Rest is self-explanatory.
I just started out with Arch - so if there is any better/standard method to achieve the same - please suggest.
This, like the other commands listed here, displays installed arch packages. Unlike the other ones this also displays the short description so you can see what that package does without having to go to google. It also shows the largest packages on top. You can optionally pipe this through head to display an arbitrary number of the largest packages installed (e.g. ... | head -30 # for the largest 30 packages installed)
M is size in megabytes, man expac to see other sizes
%m is install size
%k is download size
This one-liner will output installed packages sorted by size in Kilobytes.