The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to find the path of a file? wrapster Shell Programming and Scripting 3 03-26-2008 10:31 AM
command to find the path of a file abhilashnair UNIX for Dummies Questions & Answers 3 02-17-2008 07:15 PM
to find the file with full path surjyap Shell Programming and Scripting 5 01-18-2008 03:26 PM
URGENT: UNIX FTP cannot find path error minix HP-UX 1 04-15-2006 09:54 AM
ls -R command but need complete path name on each line condor4-2 UNIX for Advanced & Expert Users 2 12-12-2005 11:22 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-24-2008
yahoo! yahoo! is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 6
Thumbs up how to find complete path of a file in unix

hi experts(novice people can stay away as it is no child's game),

i am developing a script which works like recycle bin of windows.

the problem i am facing is that when ever i am trying to delete a file which is situated in parent directory or parent's parent directory i am unable to capture the path of the file.

eg:--

i am presently working in /fs/home/u1/proj

and i am trying to delete files of parent directory or parent's parent directory as shown below......

/fs/home/u1/proj> rm ..file1

dont get confused as "rm" has been aliased with "mv" command which will move the "file1" to a directory called "recyclebin".....

My intention is to move the file1 along with its complete path so that i can retreive it back to the original directory from where it got deleted as happens in Windows(Recycle bin)........

hope there is some command such as "dirname" or something of that sort....

Thanks in advance....................

Last edited by yahoo!; 07-24-2008 at 07:21 AM.. Reason: it does not make sense
  #2 (permalink)  
Old 07-24-2008
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,259
You can check if your operating system supports the locate command;
else you can use the find command.
  #3 (permalink)  
Old 07-24-2008
Vi-Curious Vi-Curious is offline
Registered User
  
 

Join Date: Jul 2008
Location: Texas
Posts: 129
Code:
 
man find
should point you to what you need
  #4 (permalink)  
Old 07-24-2008
Ikon's Avatar
Ikon Ikon is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 669
if you are in the directory the file is in the pwd command would show the "Present Working Directory" wouldnt this be what you want?

Code:
"i am presently working in /fs/home/u1/proj"

#> pwd
/fs/home/u1/proj
  #5 (permalink)  
Old 07-25-2008
yahoo! yahoo! is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 6
hi experts,,,,,,,,,,

i am expecting relevent solution..... and pwd is not the command that i am looking for............... how can i develope the code without knowing the basic command i.e., "pwd"

i agree my project is a bit complex but still there is hope of finding a solution................

Thanks in advance............
  #6 (permalink)  
Old 07-25-2008
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,259
Did you try it out with find as stated twice above?
Closed Thread

Bookmarks

Tags
idhar

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:50 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0