Hi,
I have the following files in my directory.
hello.txt1
hello.txt_bkp
hello.txt
I wish to list only these two files.
hello.txt1
hello.txt_bkp
ls -ltr *.txt*
displays all the three instead of two.
How can I ?.... please suggest.
Hi,
I have the following files in my directory.
hello.txt1
hello.txt_bkp
hello.txt
I wish to list only these two files.
hello.txt1
hello.txt_bkp
ls -ltr *.txt*
displays all the three instead of two.
How can I ?.... please suggest.
This is not related to ls. You can use globs with any commands. Try echo *.txt*
, it will work!
? means 'one of any character', so perhaps *.txt?*