basename man page on Ultrix

Man page or keyword search:  
man Server   3690 pages
apropos Keyword Search (all sections)
Output format
Ultrix logo
[printable version]

basename(1)							   basename(1)

       basename - strip directory names from pathname

       basename string [ suffix ]

       The command deletes from string any prefix up to and including the last
       slash (/) and the suffix (if specified), and prints the result  on  the
       standard	 output.   The	command handles limited regular expressions in
       the same manner as metacharacters must be escaped if they are  intended
       to be interpreted literally.  For example:
       % basename /vmunix .x
       % basename /vmunix '\.x'
       In  the	first  example, returns because it interprets the as a regular
       expression consisting of any character followed by the  letter  In  the
       second example, the dot is escaped; there is no match on a dot followed
       by and returns

       The command is often used inside substitution marks (` `) within	 shell

       The following example shell script compiles the file and moves the out‐
       put to in the current directory:
       cc /usr/src/bin/cat.c
       mv a.out `basename $1 .c`
       The following example echoes only the base name of the file by removing
       the prefix and any possible sequence of characters following the period
       in the file's name:
       % basename /etc/syslog.conf '\..*'

See Also
       dirname(1), ex(1), sh(1)


List of man pages available for Ultrix

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net