News for hackers. Stuff that matters.
Re:Vim Creep by jdludlow on Thursday July 12, 2012 @03:19PM (#4236200)
My first week in college a distant relative of mine at the same school pulled me into the Sun lab. The sum-total of his instructions were:

* This is how you log in.

* This is ls.

* This is cd.

* This is man.

* This is apropos.

* Learn vi.

* Have fun.

What came from that 5 minute intro to Unix has been applied orders of magnitude more often than anything from 5 years of an EE degree.

Re:Vim Creep by neckbeard on Thursday July 12, 2012 @09:53PM (#4237841)
Not to detract from your point, which was similar to my intro to Unix, but I've always preferred 'man -k' to apropos, because it means remembering only one command plus it is slightly less typing.
Re:Vim Creep by stack_underflow on Friday July 13, 2012 @12:30AM (#4238219)
'man -K' is also useful, for when you want to search the contents of man pages and not just the descriptions.
Re:Vim Creep by xutopia on Thursday July 12, 2012 @03:30PM (#4236262)
Can you explain to me what apropos does?
Re:Vim Creep by jdludlow on Thursday July 12, 2012 @03:41PM (#4236327)

  $ man apropos
  
  apropos searches a set of database files containing
  short descriptions of system commands for keywords and
  displays the result on the standard output.

It answers the question "I wonder how to do [this English word]."

For example: "I wonder how I copy a file."

  $ apropos copy
Dumps out all of the matching entries from the man pages for the word "copy". If you just wanted general commands, as opposed to library functions, and assuming your system organizes man page sections in the typical manner, you can filter it down with:

  $ apropos copy | grep "(1)"
  cp                   (1)  - copy files and directories 
  cpio                 (1)  - copy files to and from archives
Re:Vim Creep by greyfade on Thursday July 12, 2012 @03:57PM (#4236420)
Instead of using `grep "(1)"`, use the `-s` switch:

    $ apropos -s1 copy
    bsdcpio (1)          - copy files to and from archives
    cp (1)               - copy files and directories
    dd (1)               - convert and copy a file
    ....
Re:Vim Creep by barrkel on Thursday July 12, 2012 @04:00PM (#4236443)
I think it's better to use grep. Knowing the options to apropos has very low value. Knowing grep has lots and lots of value.
Re:Vim Creep by tomp on Thursday July 12, 2012 @04:33PM (#4236627)
I agree. I have no idea how to use `find`. I always do `find . | grep whatever`, since I know the basics of grep.
Re:Vim Creep by Dobbs on Thursday July 12, 2012 @07:56PM (#4237482)
Learning find is a worthy investment.

    find ./ -name "*.log" -size +2G -ctime +3 | xargs -P 8 gzip
Will find all log files over 2 gigs and older than 3 days. Then it will gzip them split across 8 parallel gzip processes.
Re:Vim Creep by shazow on Thursday July 12, 2012 @03:36PM (#4236296)
This is why `man` came before `apropos`. :P

http://www.unix.com/man-page/Linux/1/apropos/

Re:Vim Creep by anextio on Thursday July 12, 2012 @03:36PM (#4236300)
It searches for a keyword in the manpages and tells you what page contains the text.

    $ apropos printf
    fmtcheck(3)              - sanitizes user-supplied printf(3)-style format string
    format(ntcl)             - Format a string in the style of sprintf
    fwkpfv(1)                - FireWire kprintf viewer
    fwprintf(3), swprintf(3), vfwprintf(3), vswprintf(3), vwprintf(3), wprintf(3) - formatted wide character output conversion
    printf(1)                - formatted output
    printf(3), fprintf(3), sprintf(3), snprintf(3), asprintf(3), dprintf(3), vprintf(3), vfprintf(3), vsprintf(3), vsnprintf(3), vasprintf(3), vdprintf(3) - formatted output conversion
    wprintf_l(3), fwprintf_l(3), swprintf_l(3), vwprintf_l(3), vfwprintf_l(3), vswprintf_l(3) - formatted wide character output conversion
Re:Vim Creep by Symmetry on Thursday July 12, 2012 @03:41PM (#4236326)
It lets you find other commands, basically. http://en.wikipedia.org/wiki/Apropos_(Unix)