1BASENAME(1)                      User Commands                     BASENAME(1)
2
3
4

NAME

6       basename - strip directory and suffix from filenames
7

SYNOPSIS

9       basename NAME [SUFFIX]
10       basename OPTION... NAME...
11

DESCRIPTION

13       Print  NAME  with  any leading directory components removed.  If speci‐
14       fied, also remove a trailing SUFFIX.
15
16       Mandatory arguments to long options are  mandatory  for  short  options
17       too.
18
19       -a, --multiple
20              support multiple arguments and treat each as a NAME
21
22       -s, --suffix=SUFFIX
23              remove a trailing SUFFIX
24
25       -z, --zero
26              separate output with NUL rather than newline
27
28       --help display this help and exit
29
30       --version
31              output version information and exit
32

EXAMPLES

34       basename /usr/bin/sort
35              -> "sort"
36
37       basename include/stdio.h .h
38              -> "stdio"
39
40       basename -s .h include/stdio.h
41              -> "stdio"
42
43       basename -a any/str1 any/str2
44              -> "str1" followed by "str2"
45
46       GNU  coreutils  online  help:  <http://www.gnu.org/software/coreutils/>
47       Report   basename   translation   bugs    to    <http://translationpro
48       ject.org/team/>
49

AUTHOR

51       Written by David MacKenzie.
52
54       Copyright  ©  2013  Free Software Foundation, Inc.  License GPLv3+: GNU
55       GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
56       This is free software: you are free  to  change  and  redistribute  it.
57       There is NO WARRANTY, to the extent permitted by law.
58

SEE ALSO

60       dirname(1), readlink(1)
61
62       The  full documentation for basename is maintained as a Texinfo manual.
63       If the info and basename programs are properly installed at your  site,
64       the command
65
66              info coreutils 'basename invocation'
67
68       should give you access to the complete manual.
69
70
71
72GNU coreutils 8.22               October 2018                      BASENAME(1)
Impressum