Reputation: 467
How can I use the ls
command to print all of those files with a .doc extension inside the "tmp" directory? (No find neither grep). Perhaps with -X
? How would it be if we used -X
?
Upvotes: 0
Views: 7005
Reputation: 865
If you're adamant on not using grep or find, as outlined here:
https://stackoverflow.com/a/1447974/1666167
You can do something like this:
ls *.{mp3,exe,mp4}
What this looks like for .doc files in the tmp directory is this:
ls /tmp/*.doc
Upvotes: 3