I want a simple list of files in a directory that is not my current directory. I run ls /other/directory/*.txt
and get:
/other/directory/file1.txt /other/directory/file2.txt
I want:
file1.txt file2.txt
How can I get the second list?
linuxls
I want a simple list of files in a directory that is not my current directory. I run ls /other/directory/*.txt
and get:
/other/directory/file1.txt /other/directory/file2.txt
I want:
file1.txt file2.txt
How can I get the second list?
Best Answer
(cd /other/directory && ls)