Commands using arecord (9)

What's this? 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

The top ten commands you use

Simple multi-user encrypted chat server for 5 users
Client ~$ ncat --ssl localhost 9876 Change localhost to the correct ip address.

Show File System Hierarchy
Curious about differences between /bin, /usr/bin, and /usr/local/bin? What should be in the /sbin dir? Try this command to find out. Tested against Red Hat & OS X

Display or use a random file from current directory via a small bash one-liner
An other way to run it ( playing a random file ending with avi, flv or mpeg ) from a specified dir and a specified type of extension : making MOVIE array with a glob : $ MOVIE=( /PATH/TO/MY/FAVORITE/MOVIES/*.{avi,flv,mpeg} ) playing the random file from a random key from the array $ mplayer ${MOVIE[ RANDOM % ( ${#i[@]} + 1 ) ]]} I use only globs and a bash array. I use GNU bash, version 3.2.48

Find Duplicate Files, excluding .svn-directories (based on size first, then MD5 hash)
Improvement of the command "Find Duplicate Files (based on size first, then MD5 hash)" when searching for duplicate files in a directory containing a subversion working copy. This way the (multiple dupicates) in the meta-information directories are ignored. Can easily be adopted for other VCS as well. For CVS i.e. change ".svn" into ".csv": $ find -type d -name ".csv" -prune -o -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type d -name ".csv" -prune -o -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate

download and unpack tarball without leaving it sitting on your hard drive

Join lines and separate with spaces
Read vmargs.txt, which is a text file that could either be DOS-style (\r\n) or UNIX-style (\n) line endings and join the lines with a space separator. Can this be shortened/made more elegant?

Simplest way to get size (in bytes) of a file

Stop All Wine Apps and Processes
kills all wine running apps and processes. Make a hotkey for it when running wine games in fullscreen and it locks. This is a great way to escape from it.

Edit 2 or more files in vim using vim -d
Use vim's diff mode to edit two or more files in one window. The '+diffoff!' turns off diff highlighting when the session is started. Use ctrl+w + ctrl+w to switch between windows.

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.


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: