Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!amdcad!sun!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.unix.questions Subject: Re: Wanted: How to strip off pathnames to obtain filenames. Keywords: Any efficient way to generate "pr filenames" from "usend pathnames"? Message-ID: <345@quintus.UUCP> Date: 2 Sep 88 11:20:33 GMT References: <5968@ihlpf.ATT.COM> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 10 In article <5968@ihlpf.ATT.COM> pcl@ihlpf.ATT.COM (pcl) writes: >My question is, given a full or partial pathname, how to obtain the >last field (which is the filename) in a straight foward manner. If you have the 'basename' command, that does what you want. An example: $ FullName=/this/is/just/a/test $ basename $FullName test $ dirname $FullName /this/is/just/a