Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all folks,
Kindly advise
What other commands shall be used to find the directory and subdirectories of an application other than "locate" command
Thanks in advance.
satimis

Try the find command.
find application starting in current directory:
find -name applicationfind application starting in root directory:
find / -name applicationfind application starting in current directory but ignore other filesystems:
find -mount -name application-mount option is useful if you also have windows partitions mounted and you want to confine your search to the linux partitions.
See man find for other options.

Other options that might help find the executable are -perm +001 to check for world execute permission and -type f to check if it's a file.
If you can run the program but want to know where it is, you can use "which" to give you the exact path.
"whereis" searches a predetermined list of common locations for executables, so if you don't want all the results from locate (man pages, libraries, etc.), and the program isn't in your path, whereis could help.

type is an alias for "whence -v". whence looks through you aliases, function definitions and PATH directories to tell you what the shell would do with the specified command.
whereis just checks the standard bin directories e.g. /etc/bin.
e.g:
$ type type
type is an alias for 'whence -v'$ whereis type
[returns nothing]

Hi William,
Thanks for your response.
Something is different in my system
Both as 'root' and 'user'
$ type type
type is a shell builtin$ whereis type
type: /usr/share/man/man1/type.1.gz

That's OK, it just means that you have a man page for type installed on your system whereas WilliamRobertson doesn't. My outputs are exactly the same as yours (except mine is type.1.bz2), they probably just vary slightly for different distros.

The results I got are from HPUX. Predefined aliases are the kind of thing that does vary from one implementation to another. I had a feeling I'd seen 'type' used for something else on other systems, maybe something like 'file' (which returns an informed guess as to the type of file, e.g. "file $(whence vi)" ), though thinking about it "shell builtin" normally applies to things like "typeset". Out of interest, what does it do on your system? (Shell builtins would probably be documented under "man ksh".)

Nah...type still does the same job, eg under my Mandrake:
# type ls
ls is aliased to `ls -F --color=auto'I'm using bash which I assume has type built in as there is no whence command.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |