How to find a file if we dont know exact location of file ?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to find a file if we dont know exact location of file ?
# 1  
Old 01-04-2012
How to find a file if we dont know exact location of file ?

Hi

I want know "How to find a file if we dont know exact location of file ?"


Thanks,
Tushar JoshiSmilie
# 2  
Old 01-04-2012
Quote:
Originally Posted by tusharjoshi
Hi

I want know "How to find a file if we dont know exact location of file ?"


Thanks,
Tushar JoshiSmilie
The key word from above is 'find'. Look into find.
# 3  
Old 01-04-2012
Hi vgersh99,

In FIND command we need to mention the filepath.

Could you help me with exact command ?


Thanks Smilie
# 4  
Old 01-04-2012
If you can guess that your file is under your home directory somewhere and its name is myFile.txt
Code:
find ~ -type f -name myFile.txt

# 5  
Old 01-04-2012
hi,

you can think to indicate / (aka the root of filesystem) as the path to search from.

see ya
# 6  
Old 01-04-2012
It works.

Thanks Smilie

---------- Post updated at 02:08 AM ---------- Previous update was at 01:57 AM ----------

Hi

I remember i have create a file "Dechistory" before a month. But i dont remember exact location.

I know i need to find out first that fiiles exact location for renaming it .......but i waant to that without going on that location.......how to do that ???
# 7  
Old 01-04-2012
Quote:
Originally Posted by tusharjoshi
It works.

Thanks Smilie

---------- Post updated at 02:08 AM ---------- Previous update was at 01:57 AM ----------

Hi

I remember i have create a file "Dechistory" before a month. But i dont remember exact location.

I know i need to find out first that fiiles exact location for renaming it .......but i waant to that without going on that location.......how to do that ???
So start from root:
Code:
find / -type f -name 'Dechistory'

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Find file dont have that string

I have 13 text files and almost all of them contain the same string. but some file has diffrent string inside. I want to send that file which has a diffrent string inside (11 Replies)
Discussion started by: Sagar Singh
11 Replies

2. Shell Programming and Scripting

Find and Copy file of specific location

Dear All, I need to transfer all files present in one location to another but those files should be of specific extension like. Find and copy all files of extension .xls, .pdf, .txt from location usr/tmp to location /per/Treat (6 Replies)
Discussion started by: yadavricky
6 Replies

3. UNIX for Dummies Questions & Answers

Find the location of particular file and directory

hi all, i am new to UNIX environment. i have a file and directory with same name, i don't know the location I want to find location of that file and directory. please suggest a solution. (5 Replies)
Discussion started by: mahesh1987
5 Replies

4. Shell Programming and Scripting

How to find a existing file location and directory location in Solaris box?

Hi This is my third past and very impressed with previous post replies Hoping the same for below query How to find a existing file location and directory location in solaris box (1 Reply)
Discussion started by: buzzme
1 Replies

5. UNIX for Advanced & Expert Users

Find exact path of a file/directory

Hello Folks, A wrapper takes an argument of file or directory name. I want to allow paths that reside within the current directory only. Can simply discard the paths like "/A" & "../" as they go outside the current by looking at the path beginning. How to validate this one: A/../../../b... (4 Replies)
Discussion started by: vibhor_agarwali
4 Replies

6. Shell Programming and Scripting

Find file with exact access date

Hi I have to write command that find the files/dirs in the directory with access date equal to timestamp. ie or to be more precise I need to find files which are not equal to given timestamp drwxr-xr-x 2 oracle oinstall 4096 May 31 2007 tmp so need to have something like find . *... (2 Replies)
Discussion started by: zam
2 Replies

7. Shell Programming and Scripting

Find a pattern in a file at a particular location

Hi all, I have a question on how to search for a pattern in a file and return a value if it is present at that particular location. How to read each line and each character for the pattern in the file of any format. Eg for the file format: attached the file (1 Reply)
Discussion started by: sparks
1 Replies

8. UNIX for Dummies Questions & Answers

How to find exact text in file ?

I have file named shortlist , and it contains this: 2233|charles harris |g.m. |sales |12/12/52| 90000 9876|bill johnson |director |production|03/12/50|130000 5678|robert dylan |d.g.m. |marketing |04/19/43| 85000 2365|john woodcock |director |personnel... (1 Reply)
Discussion started by: Cecko
1 Replies

9. Shell Programming and Scripting

Find Exact word in file

Hi ALL, I want to search one string “20 “ i.e 20 with space. But my file where I am searching this “20 “ contain some data like 120 before image file truncated 220 Reports section succeeded 20 Transaction database .prd stopped 220 Reports section completed. When I search for the... (5 Replies)
Discussion started by: Jeevan Salunke
5 Replies

10. Shell Programming and Scripting

how to find the exact pattern from a file?

Hi Let say there is a file a.txt which contain number rows. My intention is to find the number of occurences of a pattern. Let say the pattern is mdbase. then it should not count the occurences of mdbase1 or mdbase2 like this. When I tried to find it like grep "/backup/surjya/mdbase"... (7 Replies)
Discussion started by: surjyap
7 Replies
Login or Register to Ask a Question