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:
* 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.
I did not come up with this one myself, but found this somewhere else several months ago.
-t file time length
-o file name params: @n counter, @f - source file name
-d output directory
"git grep" automatically excludes untracked files (e.g. compiler output) and files under .git directory. If no directory or file is given, it will recursively search through the current directory.
I _think_ you were trying to delete files whether or not they had spaces. This would do that. You should probably be more specific though.
This one works without an external program (watch). Witch is not await able all the time. HINT: use CTRL + C to exit the loop.
This command will delete all files and folders except 'skipme'. it could be a file or a folder.
this easy to install tool redirects all traffic to internet through ssh. it's very usefull when connecting to free wifi. you need to start it as root because it needs permissions to change iptables settings. ofcourse you also need a shell account
Place this in your .bashrc (or run it once) to set the `tasks` alias. Next time you enter `tasks` into a terminal, it will give you a list of all TODO and FIXME comments in the current directory and child directories, giving you a quick overview of what you still have to do!
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
Usage: t2s 'How are you?'
Nice because it automatically names the mp3 file up to 15 characters
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.
Useful for window managers like i3.
With a plugin like Mailbox Alert on can run this command each time a new mail arrives and it will be lighlighted by the window manager.
Use this command if you want to control the size of the files in human readable, every one second.
When you do a ls -1 | xargs rm it wouldn't workd because those files have spaces. So you must use
find -print0 and xargs -0