Answers for "shell script get file with extension"

3

extract file extension bash

FILE="/path/to/file.extension" 
echo "$FILE" | rev | cut -d '.' -f 1 | rev
Posted by: Guest on April-19-2021
3

bash find files with extension

# syntax
find </path/to/dir> -name '.<extension>'

# example 
find /export/home/jacquesk -name '*.txt'

# This will search in folder-path (including subdirectories) 
# of "/export/home/jacquesk", and will show any files 
# that end in '.txt'
Posted by: Guest on May-04-2020

Code answers related to "shell script get file with extension"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language