Commands by mattmartini (2)

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. 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.

Share Your Commands


Check These Out

AES file encryption with openssl
To decrypt: openssl aes-256-cbc -d -in secrets.txt.enc -out secrets.txt.new Reference: http://tombuntu.com/index.php/2007/12/12/simple-file-encryption-with-openssl Optional parameter -a makes output base64 encoded, can be viewed in text editor or pasted in email

Customer Friendly free
makes more sense to customers XD

Show all programs on UDP and TCP ports with timer information
-p PID and name of the program -u on a UDP port. -t also TCP ports -o networking timer -n numeric IP addresses (don't resolve them) -a all sockets

list files recursively by size

Create a backup of the file.
It will create a backup of the filename. The advantage is that if you list the folder the backups will be sorted by date. The command works on any unix in bash.

list block devices
Shows all block devices in a tree with descruptions of what they are.

grep certain file types recursively
-exec works better and faster then using a pipe

.inputrc keybinding to wrap current line in inotifytools for instant compile/test-as-you-save-loop
Assuming you've written all of make -j hfst-tokenize && echo doavtter gr?dakursa|./hfst-tokenize --gtd tokeniser-gramcheck-gt-desc.pmhfst and want that to execute every time you :w in vim (or C-xC-s in Emacs), just hit and it'll turn into $ while true; do ( make -j hfst-tokenize && e doavtter gr?dakursa|./hfst-tokenize --gtd tokeniser-gramcheck-gt-desc.pmhfst ); inotifywait -q -e modify -e close_write *; done with the cursor right before the ')'. Hit enter, and it'll run on each save. Requires the package inotify-tools installed.

list block devices
Shows all block devices in a tree with descruptions of what they are.

Command for JOHN CONS
Would create a file with a meaningful title. Dedicated to John Cons, who is annoying us users. Merry Christmas!!!


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: