basename

/ˈbeɪsnaɪm/

Definitions

1. noun

The part of a file path that comes before the first occurrence of a directory separator.

“The basename of the file /path/to/file.txt is ‘file.txt’.”

2. verb

To remove the directory path from a file path, leaving only the filename.

“The shell command basename removes the directory path from the file path.”

Synonyms

  • filename
  • name

Antonyms

  • directory
  • pathname