The UNIX and Linux Forums  

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 out pathname from inode number axes UNIX for Advanced & Expert Users 3 09-26-2008 06:44 AM
display pathname of the login shell nadman123 Shell Programming and Scripting 1 04-14-2008 04:15 PM
Getting pathname variables with ksh BCarlson Shell Programming and Scripting 7 09-16-2005 04:40 AM
how to get the last dir from a pathname using IFS sam2004 UNIX for Dummies Questions & Answers 2 03-30-2005 07:34 PM
cpio restore - relative pathname sureshy UNIX for Dummies Questions & Answers 4 08-27-2002 06:28 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-27-2002
Registered User
 

Join Date: Jun 2002
Location: London Uk
Posts: 14
find without pathname

How can I get the results of a find back without the pathname

for example if i do

find ../../ -name \*.sql

i dont want to see

directory/directory/filename.sql

I only want to see filename.sql
Forum Sponsor
  #2  
Old 06-27-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
Try:
find ../../ -name \*.sql -print | sed 's=.*/=='
  #3  
Old 06-27-2002
Registered User
 

Join Date: Jun 2002
Location: London Uk
Posts: 14
Cheers perdarbo. This seems to work.

What exactly is this doing? Are there any shortfalls?
  #4  
Old 06-27-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
That sed command deletes everything up to the last slash, which is pretty much what you asked for.

There are no "shortfalls" that I know of. As far as I know, it is right on the mark.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:24 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0