Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
Due to network maintenance being performed by our provider, LQ will be down starting at 05:01 AM UTC. The exact duration of the downtime isn't currently known. We apologize for the inconvenience.
|
 |
02-19-2009, 12:14 PM
|
#1
|
|
LQ Newbie
Registered: Dec 2008
Posts: 11
Rep:
|
Find a file path and directory path
Hi All,
What is the command we need to use to find out a path for a particular file and directory??
Thanks in advance.
|
|
|
|
02-19-2009, 12:29 PM
|
#2
|
|
Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 11,805
|
Quote:
Originally Posted by ak.lokesh
Hi All,
What is the command we need to use to find out a path for a particular file and directory??
Thanks in advance.
|
Take a look at either the locate or find commands. Type in "man locate" or "man find". You don't say anything about the version/distro of Linux you're using.....
|
|
|
|
02-19-2009, 12:35 PM
|
#3
|
|
Senior Member
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Rep: 
|
You can use which, find and whereis commands.
Code:
which firefox
/usr/bin/firefox
Code:
whereis firefox
firefox: /usr/bin/firefox /usr/lib/firefox /usr/bin/X11/firefox /usr/share/man/man1/firefox.1.gz
Code:
find / -name firefox
/usr/lib/firefox
/usr/lib/firefox/firefox
Last edited by alan_ri; 02-19-2009 at 12:43 PM.
Reason: adding find command example
|
|
|
|
02-19-2009, 12:37 PM
|
#4
|
|
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,577
|
What is the context or purpose for needing this information?
For files in the current directory, all you need to know is where that directory is, which you can get with the pwd command. For programs and system commands you can use which; "which mplayer", for example. Note that some commands are shell built-ins or aliases and such, and won't give you any output.
As for other files on the system, if you don't already know where they are, then you can't rightly run any commands on them, can you? All you can do is use find or locate to search for them.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:47 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|