LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to search a perticular file in fedora ??? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-search-a-perticular-file-in-fedora-926433/)

abi 01-30-2012 01:57 AM

how to search a perticular file in fedora ???
 
1)how to search a particular pdf or folder path in fedora??

2)if there is a file named project_latest ,but while searching i am not able to remember its name completely(eg i know the file starts with filename project) then is there any way that i can find its path???

EricTRA 01-30-2012 02:08 AM

Hello,

Have a look at the man page for find:
Code:

man find
Another option is to use locate, if you run updatedb on a regular basis:
Code:

man locate
man updatedb

Since this is basic knowledge, might I suggest you read some basic documentation such as this one?

Kind regards,

Eric

Satyaveer Arya 01-30-2012 02:25 AM

Quote:

if there is a file named project_latest
You can search this file like this:

Like in / directory:
Quote:

# find / -name project_latest
OR

Quote:

# locate project_latest
For using other switches, see the man page of find and locate as suggested by EricTRA

salasi 01-30-2012 04:09 PM

Quote:

Originally Posted by abi (Post 4587946)
2)if there is a file named project_latest ,but while searching i am not able to remember its name completely(eg i know the file starts with filename project) then is there any way that i can find its path???

If you mean that literally all that you remember about the filename is that it contains project and nothing else then

Code:

locate project
will do that, but may well give a large number of hits (err, actually will give a large number of hits) if you have a large number of filenames that contain the string 'project', which is quite possible.

If, on the other hand, you can remember some stuff about the pathname, just not quite the exact filename, then there are still things that you can do. So, imagine that you can remember that it is in a home directory, you could try

Code:

locate project | grep -i home
Which may reduce the number of results, somewhat. (And, now for my favourite, rather minimalistsic, comment: ) Etc.

abi 02-01-2012 03:29 AM

thank you all,i have recieved positive answers which helped to find the sol to the thread.

jainjohny 02-01-2012 03:59 AM

Hi Abi,

The simpler way to find a file is " find (directory) | grep (file name), if you are not aware where is file location use command as find / | grep (file name).

Thanks & Regards,
Jain.T.J

EricTRA 02-02-2012 02:23 AM

Quote:

Originally Posted by abi (Post 4590166)
thank you all,i have recieved positive answers which helped to find the sol to the thread.

Hi,

If you've found a solution and consider your problem solved, then please mark the thread as such. Also in the spirit of the community, post what you considered a solution so that others in a similar situation might see if it applies to their question/problem too.

Kind regards,

Eric


All times are GMT -5. The time now is 05:29 AM.