*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> basename (1)              
Title
Content
Arch
Section
 

BASENAME(1)

Contents


NAME    [Toc]    [Back]

     basename - return filename portion of pathname

SYNOPSIS    [Toc]    [Back]

     basename string [suffix]

DESCRIPTION    [Toc]    [Back]

     basename deletes any prefix ending with the last slash (`/')
character
     present  in  string,  and a suffix, if given.  The resulting
filename is
     written to the standard output.  A  non-existent  suffix  is
ignored.

     The  basename  utility  exits 0 on success or >0 if an error
occurred.

EXAMPLES    [Toc]    [Back]

     The following line sets the shell variable FOO to tail:

           FOO=`basename /usr/bin/tail`

SEE ALSO    [Toc]    [Back]

      
      
     csh(1), dirname(1), sh(1), basename(3)

STANDARDS    [Toc]    [Back]

     The  basename  utility  conforms  to  IEEE  Std  1003.2-1992
(``POSIX.2'').

OpenBSD      3.6                          April      18,     1994
[ Back ]
 Similar pages
Name OS Title
basename FreeBSD return filename or directory portion of pathname
dirname FreeBSD return filename or directory portion of pathname
dirname Tru64 Return the base filename or directory portion of a pathname
basename Tru64 Return the base filename or directory portion of a pathname
dirname_r Tru64 Return the base filename or directory portion of a pathname
dirname OpenBSD return directory portion of pathname
fnmatch Linux match filename or pathname
fnmatch IRIX match filename or pathname
fnmatch OpenBSD match filename or pathname using shell globbing rules
fnmatch NetBSD match filename or pathname using shell glob rules
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service