Computing.Net > Forums > Linux > Command to find directory

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Command to find directory

Reply to Message Icon

Name: satimis
Date: March 7, 2003 at 08:34:04 Pacific
OS: RH7.3
CPU/Ram: PII-350/256
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: egkenny
Date: March 7, 2003 at 12:00:50 Pacific
Reply:

Try the find command.

find application starting in current directory:
find -name application

find application starting in root directory:
find / -name application

find 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.


0

Response Number 2
Name: Jake
Date: March 7, 2003 at 22:04:04 Pacific
Reply:

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.


0

Response Number 3
Name: satimis
Date: March 8, 2003 at 08:21:15 Pacific
Reply:

Hi all,

Thanks for your response.

What is the difference between

type

and

whereis

B.Regards
Satimis


0

Response Number 4
Name: WilliamRobertson
Date: March 9, 2003 at 15:13:24 Pacific
Reply:

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]


0

Response Number 5
Name: satimis
Date: March 12, 2003 at 02:22:57 Pacific
Reply:

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


0

Related Posts

See More



Response Number 6
Name: 3Dave
Date: March 12, 2003 at 04:48:47 Pacific
Reply:

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.


0

Response Number 7
Name: WilliamRobertson
Date: March 12, 2003 at 05:18:41 Pacific
Reply:

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".)


0

Response Number 8
Name: 3Dave
Date: March 12, 2003 at 07:27:02 Pacific
Reply:

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.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Command to find directory

What is command to find shell? www.computing.net/answers/linux/what-is-command-to-find-shell/12486.html

command to find rpm of disk? www.computing.net/answers/linux/command-to-find-rpm-of-disk/23294.html

Command to change directory www.computing.net/answers/linux/command-to-change-directory/18194.html