Run an ls without getting the full path
(cd /other/directory && ls)
Is there some reason why you can not use ls -1
?
$ ls -1 /other/directory
file1
file2
EDIT:
I notice you've changed the question now - my solution won't work with your new example of ls /other/directory/*.txt
. Use something like khachik's solution instead, e.g.
$ (cd /other/directory && ls -1 *.txt)