Linux_View software installation path

Original address: http://blog.csdn.net/bulljordan23/article/details/7749270

 

If we have installed a certain software on a Linux system, we can determine it in the following three ways.

 

a Which command

The shell's which command can find out if the relevant command is already in the search path. Such as:

 

[root@localhost ~]# which gcc

/usr/bin/gcc

 

Two Whereis Commands

The Whereis command searches a wider range of system directories, independent of the shell's search path. Note that the which command on some systems does not display files for which the user does not have execute permission.

 

[root@localhost ~]# which ipppd

/sbin/ipppd

[root@localhost ~]# whereis ipppd

ipppd: /sbin/ipppd /usr/sbin/ipppd /usr/share/man/man8/ipppd.8.gz

 

Three Locate Commands

The command first looks at a precompiled index of a filesystem to determine filenames that match a particular pattern. It doesn't search for commands or packages specific, but any type of file it can find.

 

Locate's database is usually regenerated every night by the updatedb command, which is run by cron. Therefore, the result of executing a locate does not always reflect recent changes to the file system.

 

For example, look at the header file signal.h

 

[oracle@localhost ~]$ locate signal.h

warning: locate: could not open database: /var/lib/slocate/slocate.db: No such file or directory

warning: You need to run the 'updatedb' command (as root) to create the database.

Please have a look at /etc/updatedb.conf to enable the daily cron job.

[oracle@localhost ~]$ su - root

Password:

[root@localhost ~]# updatedb

[root@localhost ~]# locate signal.h

/usr/src/kernels/2.6.9-78.EL-i686/include/linux/signal.h

/usr/src/kernels/2.6.9-78.EL-i686/include/asm-i386/signal.h

/usr/src/kernels/2.6.9-78.EL-smp-i686/include/linux/signal.h

/usr/src/kernels/2.6.9-78.EL-smp-i686/include/asm-i386/signal.h

/usr/src/kernels/2.6.9-78.EL-hugemem-i686/include/linux/signal.h

/usr/src/kernels/2.6.9-78.EL-hugemem-i686/include/asm-i386/signal.h

/usr/share/doc/SDL-devel-1.2.7/html/sdlcondsignal.html

/usr/share/man/man0p/signal.h.0p.gz

/usr/include/valgrind/pub_tool_libcsignal.h

/usr/include/asm/signal.h

/usr/include/sys/signal.h

/usr/include/linux/signal.h

/usr/include/glib-2.0/gobject/gsignal.h

/usr/include/boost/signal.hpp

/usr/include/signal.h

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326720963&siteId=291194637