Commands using manpath (1)

  • If I type 'man something', I want it to find the manpage in the same order as my PATH. You can add something like this to your .bashrc # # Add my MacPorts, my personal utilities and my company utilities to my PATH. export PATH=$PATH:/opt/local/bin:$HOME/bin:/our_company_utils/bin/ # Now set the manpath based on the PATH, after man(1) parses man.conf # - No need to modify man.conf or manually modify MANPATH_MAP # - Works on Linux, FreeBSD & Darwin, unlike /etc/manpaths.d/ # Must unset MANPATH first. MANPATH is set on some systems automatically (Mac), # which causes manpath to ignore the values of PATH like /opt/local/bin (MacPorts). # Also MANPATH may be deprecated. See "SEARCH PATH FOR MANUAL PAGES" in man(1) unset MANPATH # manpath acts differently on Solaris, FreeBSD, MacOSX & GNU. This works everywhere. manpath >/dev/null # Note that MacOSX, FreeBSD & Linux have fancier ways to do some of this. (e.g. 'man --path' or 'man -q'), but this command is more universal and should work everywhere. Show Sample Output

    unset MANPATH; manpath >/dev/null
    StefanLasiewski · 2010-07-02 19:45:27 0

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

Get first Git commit hash
git log --format=%H | tail -1 doesn't work anymore

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

Share a 'screen'-session
Ater person A starts his screen-session with `screen`, person B can attach to the srceen of person A with `screen -x`. Good to know, if you need or give support from/to others.

Write comments to your history.
A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session.

Make changes in any profile available immediately/Change to default group
Changes your group to the default group, has the same effect as sourcing your profile/rc file (in any shell) or logging out and back in again.

awk date convert
Convert readable date/time with `date` command

Recursive chmod all files and directories within the current directory

Isolate file name from full path/find output
Quick method of isolating filenames from a full path using expansion. Much quicker than using "basename"

Resize a Terminal Window
Replace 70 with the desired height. Replace 180 with the desired width. I put it in my bashrc, because by default my terminal is too small.

Generate a random password
Another password maker, for human-unfriendly passwords. '-base64' output will make sure it it can be typed on a keyboard, though the output string length will always be a multiple of 4.

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: