Say I have a file
*.txt in a directory
I would like to list
*.txt files in
$txtpath from current directory (not
$txtpath) without also listing the files in the current directory, as it happens if I execute
ls *.txt $txtpath .
I manage to list the
*.txt files only in
$txtpath with this command:
find $txtpath -name '*.txt' | sed 's/\// /g' | grep -o '[^ ]*$'
But maybe there is a more elegant solution?