# Basic syntax:
basename $YOURFILE
# Example usage:
YOURFILE="/path/to/your_file.txt"
basename $YOURFILE
--> your_file.txt
# Note, to remove a specified suffix from the file name, add it at the end like:
basename $YOURFILE .txt
--> your_file
# Note, to run basename in a bash script and assign the output to a variable,
# use the following syntax:
FILENAME="$(basename -- $YOURFILE)"
# Basic syntax:
dirname /full/file/name.txt
# Example usage:
dirname /full/file/name.txt
--> /full/file
# Note, if you want just the file name, use basename, e.g.:
basename /full/file/name.txt
--> name.txt
filename='basename $file'
basename(1) - strip directory and suffix from filenames