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:
Delete items from Redis, using redis-cli, by matching a key pattern.
* Find all file sizes and file names from the current directory down (replace "." with a target directory as needed).
* sort the file sizes in numeric order
* List only the duplicated file sizes
* drop the file sizes so there are simply a list of files (retain order)
* calculate md5sums on all of the files
* replace the first instance of two spaces (md5sum output) with a \0
* drop the unique md5sums so only duplicate files remain listed
* Use AWK to aggregate identical files on one line.
* Remove the blank line from the beginning (This was done more efficiently by putting another "IF" into the AWK command, but then the whole line exceeded the 255 char limit).
>>>> Each output line contains the md5sum and then all of the files that have that identical md5sum. All fields are \0 delimited. All records are \n delimited.
En entornos de desarrollos muchas veces se mezclan ficheros y debemos revisar si algo se nos ha quedado fuera del proyecto. Con esta linea de comando busco todos los ficheros que no sean M ( modificados ) para valorar si tengo que agregarlo al repositorio de subversion.
Adem?s siempre se me olvida como usar un condicional con awk para una columna :D
This awk codes emulates tail. For efficiency it uses a circular array, which stores only N number of records. Using awk gives the flexibility of modifying the output as needed, for example adding the record number (NR) at the output and much more.
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