Searching a file withoug leaving home directory!!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Searching a file withoug leaving home directory!!
# 1  
Old 09-05-2002
CPU & Memory Searching a file withoug leaving home directory!!

hello there !

I am in my current working directory, and i want search a file in "dev" directory which is under root(/), but i donot want leave my current working directory.

is it possible to find file like that ?

let us say i am in /home/bin/user/malik/abid directory and i want find a file "testing" which is in "bin" directory.

what should i give command on my pwd to fine file in bin directory.

any suggestion will be appriciated.

Thanks
Abid Malik
# 2  
Old 09-05-2002
Read the man page on the find command. No matter where you are, you can find files in other directories (searching all sub-directories)


NAME
find - find files

SYNOPSIS
find path... expression

DESCRIPTION
The find utility recursively descends the directory hierar-
chy for each path seeking files that match a Boolean expres-
sion written in the primaries given below.
# 3  
Old 09-05-2002
Try

find /bin -name testing 2>/dev/null
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Leaving directory Error

Hi, i have a question, when I install any software it give error message like as follow : sudo make password for csm: make all-recursive make: Entering directory `/home/csm/Desktop/miRanda-3.3a' Making all in man make: Entering directory `/home/csm/Desktop/miRanda-3.3a/man' make:... (18 Replies)
Discussion started by: harpreetmanku04
18 Replies

2. Shell Programming and Scripting

Searching File in Directory and all Subdirectory and Delete

Hi All, My directory structure is like Directory1 SubDirectory1 SubDirectory2 SubDirectory3 I have main directories and subdirectories underneath. I want to write a shell script where I will be passing file name as a parameter, Now I want to find all the files in Directory1... (19 Replies)
Discussion started by: John William
19 Replies

3. Shell Programming and Scripting

Cannot run this .java file from the home directory??

I wrote a simple test.java program in vi. I know it compiles correctly because I went into the directory where test.java was and compiled it and it created a java.class. I then ran test.java by staying in the same directory where it was and it worked great. However, when i backed out of the... (3 Replies)
Discussion started by: syregnar86
3 Replies

4. Shell Programming and Scripting

Looking for config file in home directory first??

hi, i have written a shell script inside which i am using a pgp command to encrypt a file. when pgp command is run , there is a /.pgp/pgp.cfg file in my home directory. i logged into the unix server with my userid, when i run the script from the command prompt, pgp is successful, since i am... (5 Replies)
Discussion started by: Little
5 Replies

5. Shell Programming and Scripting

rename all file with blank in directory from home root , please help me

hi , :wall: I've in directory home user 3 file with blank space in name file, I would like erase the all character that no have alphanum more dot in namefile from home root , below the script. If I execute the shell script from directory where stay it's execute well done.But I would like... (1 Reply)
Discussion started by: giankan
1 Replies

6. UNIX for Dummies Questions & Answers

Searching the file in a directory

Hi Folks, I am using the putty as I need to check the logs, My query is that I know the location of my logs ..that is cd /var /logs/abc.log so I can reach to this place and open the logs in putty, But what About if I do not the location only thing I know the name of the abc.log , and I have... (1 Reply)
Discussion started by: KAREENA18
1 Replies

7. Shell Programming and Scripting

Copy file after searching in a directory

Hi, I am looking for an answer for following senario: I have a text file (base.txt) which consist list of files to be searched like: base.txt abc.txt def.txt fgh.txt Now i am going to search all the listed files in another directory after reading them one by one, once i found the... (10 Replies)
Discussion started by: apjneeraj
10 Replies

8. UNIX for Dummies Questions & Answers

How to get the latest modified file name in /home directory?

I only know how to list all sub-directories or files in specified directory. I don't know how to order them by modified date, furthermore, I don't know how to get the top one file in the sorted list. Wish you can do me a favor. Thanks in advance! (3 Replies)
Discussion started by: crest.boy
3 Replies

9. UNIX for Dummies Questions & Answers

Searching directory for file that contains some text.

If I go into a directory and type in .. more * | grep foo I get the lines of text that contain foo in all of the files in the directory out of all of the files that are there. How do I make it so I can find out what the names of the files are that contain that text "foo"? By doing what I... (4 Replies)
Discussion started by: LordJezo
4 Replies

10. Shell Programming and Scripting

searching each file in a directory for text

what command can i use to search the files in a directory for a text. the output would list the files containing the text. ive tried this but it is not exactly what im looking to do: find . -name "*.xml" -exec agrep searchstring {} \; (2 Replies)
Discussion started by: jim majors
2 Replies
Login or Register to Ask a Question