Commands using passwd (18)

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

Discovering all open files/dirs underneath a directory
It may be helpful in case you need to umount a directory and some process is preventing you to do so keeping the folder busy. The lsof may process the +D option slowly and may require a significant amount of memory because it will descend the full dir tree. On the other hand it will neither follow symlinks nor other file systems.

Create a video screencast (capture screen) of screen portion, with audio (the audio you hear, not your mic)
Errors in output don't matter. Stop recording: ctrl-c. Result playable with Flash too. IMPORTANT: Find a Pulse Audio device to capture from: pactl list | grep -A2 'Source #' | grep 'Name: ' | cut -d" " -f2

Ctrl+S Ctrl+Q terminal output lock and unlock
These are simple shortcuts to pause and continue terminal output, works in most terminals and screen multiplexers like screen. You can use it to catch something if things change too fast, and scroll with Shift + PgUp PgDown. On linux console ScrollLock can also be used.

Directory Tree
tree has lots of parms - man is your friend

create a nicely formatted example of a shell command and its output
Shell function which takes a bash command as its input, and displays the following formatted output: EXAMPLE: command OUTPUT: output from command

Remote Serial connection redirected over network using SSH
Requires software found at: Remote [A] (with physical serial port connected to device) $./remserial -d -p 23000 -s "115200 raw" /dev/ttyS0 & Local [B] (running the program that needs to connect to serial device) Create a SSH tunnel to the remote server: $ssh -N -L 23000:localhost:23000 user@hostwithphysicalserialport Use the locally tunnelled port to connect the local virtual serial port to the remote real physical port: $./remserial -d -r localhost -p 23000 -l /dev/remser1 /dev/ptmx & Example: Running minicom on machine B using serial /dev/remser1 will actually connect you to whatever device is plugged into machine A's serial port /dev/ttyS0.

read a file line by line and perform some operation on each line
see sample output

RTFM function
Sometimes you don't have man pages only '-h' or '--help'.

Find the package that installed a command

See loaded modules in apache
Easiest way to check which modules are loaded in apache.

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: