The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-26-2003
danhodges99
Guest
 

Posts: n/a
Pattern Matching

Hi,
From a list of directory paths, I need to get only what appears after the last "/" in the path, for example:
From /usr/bin/ftp, I only want "ftp".
From /var/apache/htdocs/project/index.html, I only want "index.html".
Hope this makes sense as it's really been bugging me, I'm guessing there is an awk or sed command that can be used, but I can't find it! Ta.
Forum Sponsor