[Linux] Linux operating system ---- view the location of installed software

If we in the Linux  a piece of software installed on the system, we can determine the following three ways.

 

One. Which command

Shell, which command can find out if the relevant command has been in the search path. Such as:

 

[root@localhost ~]# which gcc

/usr/bin/gcc

 

two. Whereis command

Whereis command to search for a wider range of system directories, and search path independent of Shell. To note, which commands some system files on the user does not have execute permissions are not displayed.

 

[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 command

This command will first examine pre-compiled index a file system, in order to determine the specific pattern that matches the file name. It does not search for a specific command or a package, but can be any type of file found.

 

Locate the database libraries are often regenerated by the command updatedb every night, this command to be run by cron. Therefore, the results of the implementation of a locate is not always possible to reflect the recent changes in the file system.

 

For example, to view the header files 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 blog.csdn.net/ningjiebing/article/details/89410929