how to find a path within unix root directory


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how to find a path within unix root directory
# 1  
Old 06-08-2009
how to find a path within unix root directory

I need to know whether nyfile/mypath exists on the file system in the root directory.
How to do this
# 2  
Old 06-08-2009
To list a file
Code:
ls -l <mypath/myfile>

To find a file:
Code:
find / -name <myfile>

To find out of a file is in our executable PATH:
Code:
which <myfile>

Padow
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find if a directory exist from a list of the path

Hello, i want to script on sh to check from a path if the directory exist and isn't empty. I explain: path is : /aaa/bbb/ccc/ccc_name/ddd/ Where the cccc_name is in a list, so i think it's $1 My command find -name /aaa/bbb/ccc/$1/ddd/ didn't work because my $1 is the same and not... (5 Replies)
Discussion started by: steiner
5 Replies

2. UNIX for Dummies Questions & Answers

Extract directory name from the full directory path in UNIX using shell scripting

My input is as below : /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/loyal/IFIND.HELLO.WROC.txt /splunk/scrubbed/triumph/ifind.triumph.txt From the above input I want to extract the file names only . Basically I want to... (5 Replies)
Discussion started by: IshuGupta
5 Replies

3. UNIX for Dummies Questions & Answers

Find command fails when a space is in the directory path variable

I have a script like this running under OS X 10.8. The problem arises when the find command encounters a space in the path name. I need the "dir" variable as I'll be extending the script to more general use. #!/bin/bash CFS=$IFS IFS=$(echo) set dir = "/Users/apta/Library/Mail\... (3 Replies)
Discussion started by: apta
3 Replies

4. Shell Programming and Scripting

Find file and zip without including directory path

Does anyone know of a way to zip the resulting file from a find command? My approach below finds the file and zips the entire directory path, which is not what I need. After scanning the web, it seems to be much easier to perform gzip, but unfortunately the approach must use zip. find `$DIR`... (5 Replies)
Discussion started by: koeji
5 Replies

5. Shell Programming and Scripting

a little help with find and directory path for application

Just a little backgroud, I have a library of mp3 files in the following structure: /mp3/artist/album/track.mp3 Also contained in each album directory is a cover.jpg which contains the cover art file for that particular album. I want to add the cover.jpg to the mp3 tag and have been using... (8 Replies)
Discussion started by: barrydocks
8 Replies

6. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies

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

8. AIX

how to find whats filling up Root Directory

Hi guys I am running AIX 5.3 and a newbie to it. And I am getting reports telling me that the Root Directory is reaching almost max capacity, can someone give m some advice to find out what files are causing it to grow? , or how I can identify the growing files? Thanks (6 Replies)
Discussion started by: ryanbsc@gmail.c
6 Replies

9. UNIX for Advanced & Expert Users

How to find all the log files under the root directory -- Need Info

Hi I need to find all the log files under the root directory and delete them if necessary, if any one has a sample script who can share with me. Thanks (2 Replies)
Discussion started by: gkrishnag
2 Replies

10. UNIX for Dummies Questions & Answers

Question about Restricting Search path of FIND to current directory

Hi, By default FIND command searches for matching files in all the subdirectories within the specified path. Is there a way to restrict FIND command's search path to only the specified directory and NOT TO scan its subdirectories. Any help would be more than appreciated. Thanks and Regards (2 Replies)
Discussion started by: super_duper_guy
2 Replies
Login or Register to Ask a Question