Re: Cut patten between slashes

From: Nick Landsberg (hukolau_at_NOSPAM.att.net)
Date: 05/22/04


Date: Sat, 22 May 2004 12:42:08 GMT

Wyatt wrote:
> I have a file listed as
>
> /dir1/sd11/sd111/sd1111/file1
> /d2/sd2/file2
> /d3/sd31/sd34/sd345/sd3456/sd34567/file3
>
> I want to extract only filenames from this and write them into another file
>
> file1
> file2
> file3
>
> How do I do this ? Anyhelp is appreciated.

man basename

-- 
"It is impossible to make anything foolproof
because fools are so ingenious"
  - A. Bloch


Relevant Pages

  • Re: Cut patten between slashes
    ... On 2004-05-22, Wyatt wrote: ... > I want to extract only filenames from this and write them into another file ... and may be copied under the terms of the GNU General Public License ...
    (comp.unix.questions)
  • Re: sort files by exif date
    ... >> and the filenames in a list, sort, then extract the filenames again. ... >> Probably a few lines of shell script. ... That string will be a line of text. ...
    (comp.unix.questions)
  • Re: A silly question about tar
    ... Florian Kulzer wrote: ... filenames in one line, separated by spaces. ... It looks like the "extract" action interprets the first filename ... not the tar command itself. ...
    (Debian-User)
  • Re: finding a value in a string
    ... if you see the filenames that i have mentioned, ... within the last 5-6 characters. ... thats a sort of version number and thats what i am looking to ... extract. ...
    (microsoft.public.excel.misc)
  • Re: sort files by exif date
    ... list of filenames, extract the required data from the files and put it and the filenames in a list, sort, then extract the filenames again. ... Probably a few lines of shell script. ...
    (comp.unix.questions)