List all files by type
Dumb question I couldn't find the answer to.
How do I (in the command line) list all the .txt (or any common attribute) files in a directory? |
Hi,
ls -l *txt or ls *txt Have a look at the man page (man ls) to see all the other options. Hope this helps. |
Hi,
There are no dumb questions :) A couple of possible solutions: Code:
ls /path | grep "*.txt" Kind regards, Eric |
@EricTRA: ls /path | grep "*.txt" ?? How does that work ;)
ls /path | grep ".txt$" or shorter: ls /path/*.txt BTW: Same "mistake" in the find command *.txt vs .txt |
Hi druuna,
Of course you're right :) My mistake, apparently wasn't thinking straight. Thanks for pointing it out. Mixed up commands just like my mind being mixed up for lack of sleep :o Kind regards, Eric |
All times are GMT -5. The time now is 08:36 PM. |