0

In the following, I would like to suppress just the lines that say "No such file or directory. Can you show me how that can be done (I've tried looking at the man page, and trying grep or other ways, but have not found a way to do this)?

ls -al *.sh *.py *.exe *.bat *.cmd *.ps1

OUTPUT:
ls: cannot access '*.py': No such file or directory
ls: cannot access '*.exe': No such file or directory
ls: cannot access '*.bat': No such file or directory
ls: cannot access '*.cmd': No such file or directory
ls: cannot access '*.ps1': No such file or directory
-rw-r--r-- 1 boss boss 147K Sep 30 12:44 custom_loader.sh
-rw-r--r-- 1 boss boss  47K Sep 30 12:44 more_apps.sh

DESIRED OUTPUT:
-rw-r--r-- 1 boss boss 147K Sep 30 12:44 custom_loader.sh
-rw-r--r-- 1 boss boss  47K Sep 30 12:44 more_apps.sh
YorSubs
  • 2,214
  • 2
  • 24
  • 38

0 Answers0