ome more.
apropos file | grep -i -e “(1)” -e “(8)” | grep -i “open”
gimp-remote [gimp-remote-2] (1) – tells a running GIMP to open a (local or remote) image file
lsof (8) – list open files
Right! lsof! Of course!
Before apropos is useful, you have to run the command: makewhatis
makewhatis (8) – Create the whatis database
makewhatis creates the whatis database, by reading key sections of all the man pages. When I worked on Sun Microsystems operating systems, I remember the equivilent command was catman. Either will take a number of minutes to finish. It’s write once, read many, so you just need to do it the once.
Then, you can also use the command: whatis. This is useful when you are instructed to use a command online you haven’t seen before. Before running the command, you can check what it does.
vfs_catia (8) – translate illegal characters in Catia filenames
Other useful commands that I use include, which and file.
which will tell where exactly a file is located in your search path:
file will tell you what type of file it is:
/sbin/sysctl: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
There are many types of files:
/etc/rc5.d: symbolic link to `rc.d/rc5.d’
/etc/rc6.d: symbolic link to `rc.d/rc6.d’
/etc/rc.local: symbolic link to `rc.d/rc.local’
/etc/rc.news: Bourne shell script text executable
/etc/rc.sysinit: symbolic link to `rc.d/rc.sysinit’
/etc/reader.conf: ASCII English text
You then always can use the man pages for more info. Go to SEE ALSO for related commands.
One of my beefs about the man pages is that they often tell me everything, except what I need to know. In fact, for apropos, the critical fact that you need to first run makewhatis is not found at all in SEE ALSO. Perhaps that’s why it’s not used much.
Usually I just need a simple example that works. I find I get much better info from blogs these days. Why can’t those who write man pages do similar?
Using apropos has allowed me learn many things about unix and linux that I would not have discovered otherwise. You can spend a lot of time with it, and learn heaps.