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:
The "proportional set size" is probably the closest representation of how much active memory a process is using in the Linux virtual memory stack. This number should also closely represent the %mem found in ps(1), htop(1), and other utilities.
Same as the rest, but handle IPv6 short IPs. Also, sort in the order that you're probably looking for.
This gets the Nth argument in the last line of your history file. This is useful where history is being written after each command, and you want to use arguments from the previous command in the current command, such as when doing copies/moving directories etc.
I wrote this after getting irritated with having to continually type in long paths/arguments.
You could also use $_ if all you want is the last argument.
To sort the list by file/directory size, insert `sort -n |` before `awk`.
This command give you Just the Network Cidr Notation
This will find all the -Xmx[BIGINT] running on a system, add them up for you and give you the total.
Solves these pesky errors you see in the Apache log:
[Fri Jun 28 17:51:00 2013] [emerg] (28)No space left on device: Couldn't create accept lock (/monsoon/opt/apache2/logs/accept.lock.356) (5)
Naturally, can be used to get rid of other semaphores. Note: change the apache user in accordance to your ENV.
..not guaranteed to always be accurate but fun to see how old you Linux installation is based on the root partitions file system creation date.
List system current active ip address
becuase im lazy and cant be bothered looking at the tv guide to choose a channel , any improvments or comments appreciated
Is the better option on a Open SuSE Box
pretty much the same.
I use awk rather than grep and perl.
It looks like the URL has been updated.
The service tag can also be retrieved via snmp - potential for a for loop over a list of servers. I might have a look into doing an example.
Automatically drops mount points that have non-numeric sizes (e.g. /proc). Tested in bash on Linux and AIX.
This will strip out the relivent disk information from kvm. I'm using it to find disks on a SAN which are no longer in use.