finding pathname for directory


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers finding pathname for directory
# 1  
Old 09-26-2008
finding pathname for directory

Hi
Could someone help me?
I'm not sure how to find the full pathname of a directory.

I just want to be able to specify a directory.
e.g

directory1/directory2/directory3/directory4/directory5

I want to be able to put in "directory5"
and then i want a return of the full address.

Thanks
# 2  
Old 09-26-2008
There is a command you know: pwd
if you specify form where you are to put file in
directory1/directory2/directory3/directory4/directory5

you might not get as absolute path:
/directory1/directory2/directory3/directory4/directory5/file
but more likely
`pwd` of where you were at he time of the copy/directory1/directory2/directory3/directory4/directory5/file

But truly I am not sure I understood your question...
# 3  
Old 09-26-2008
If you want to search for the full path of your directory you can try find:

Code:
find / -type d -name "*directory5" 2>/dev/null

Regards
# 4  
Old 04-08-2009
Hi,

Try the command

dirs
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding the file name in a directory with a pattern

I need to find the latest file -filename_YYYYMMDD in the directory DIR. the below is not working as the position is shifting each time because of the spaces between(occuring mostly at file size field as it differs every time.) please suggest if there is other way. report =‘ls -ltr... (2 Replies)
Discussion started by: archana25
2 Replies

2. Debian

Finding out size of sub-directory

Hi, Is there a way to find out the size of a sub-directory? Eg subidrectory in main directory /data, like this : /data/solr-5.3.1. When I do a df -h /data/solr-5.3.1, it still gives the size of /data: root@L28condor:/data/solr-5.3.1# df -h . Filesystem Size Used... (1 Reply)
Discussion started by: anaigini45
1 Replies

3. Red Hat

Finding version of firefox in directory

I have a unique situation, I have a RHEL OS but also a file path that has a OS image (it is not the image running on the machine) if I run fire fox -version it will give me the version of the actively installed FF however I need to know if the version of FF sitting in the non active path is the... (4 Replies)
Discussion started by: cybersecEG
4 Replies

4. UNIX for Dummies Questions & Answers

Renaming files with part of their pathname and copying them to new directory

Hi I think this should be relatively simple but I can't figure it out. I have several files with the same name in different folders within a directory (the output of a program that I ran). Something like this: ./myAnalysis/item1/round1/myoutput.txt ./myAnalysis/item1/round2/myoutput.txt... (2 Replies)
Discussion started by: jullee
2 Replies

5. Shell Programming and Scripting

how to take absolute pathname to a directory in korn shell

how to take absolute pathname to a directory in korn shell (2 Replies)
Discussion started by: babuda0059
2 Replies

6. Shell Programming and Scripting

Finding files in directory

Hi, I need help in writing shell script to accomplish the following. 1.I've one text file which contains list of batch numbers like b1.dat,b2.dat,b3.dat... 2.I've the same files along with other files present in some directory.i.e 1.dat,2.dat,3.dat,4.dat,5.dat... present in some directory.... (3 Replies)
Discussion started by: narranil2
3 Replies

7. Shell Programming and Scripting

finding the 5 newest files in a directory

I have a folder that has new files created everyday, is there a way i can filter them so that only the 5 newest files are displayed? I'm hoping this can be done by a one liner without a script. for example my directory contains -rw-r--r-- 1 root root 0 Jun 24 08:34 file112 -rw-r--r-- 1 root... (2 Replies)
Discussion started by: zerofire123
2 Replies

8. UNIX and Linux Applications

Finding the oldest file in a directory without ls

I am trying to determine the oldest and most recent files in a huge directory. I am using an ls -tr statement outside my find statement. The directory is too big and I am getting an "arg list too long" error. Is there something I can put in my find statement that doesn't create a list to... (2 Replies)
Discussion started by: hiyofjord
2 Replies

9. Shell Programming and Scripting

Finding all the files in a directory

I need to find all the files with a given file name present in the sub directories and execute a script on each file For example In the directory source , I need to find all the files named test and execute the script run.sh Can anyone please help me on this (4 Replies)
Discussion started by: prav076
4 Replies

10. UNIX for Dummies Questions & Answers

finding file in a directory

hi can i know how to locate a file in a directory by using the "find" command? i want to know the exact path the files reside in in the result. thanks :confused: (4 Replies)
Discussion started by: legato
4 Replies
Login or Register to Ask a Question