Horje
bash file name from absolute path Code Example
bash file name from absolute path
# 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)"




Shell

Related
make zsh for all users Code Example make zsh for all users Code Example
uninstall mssql server ubuntu Code Example uninstall mssql server ubuntu Code Example
bash list the top ten largest values in a column Code Example bash list the top ten largest values in a column Code Example
install java 17 ubuntu Code Example install java 17 ubuntu Code Example
bily-101 github Code Example bily-101 github Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
13