If I type ls *ro* I also get files in subdirectories that match the *ro* pattern.
Is there any option for ls similar to prune?
Ideally a flag, otherwise perhaps an exec?
Use the -d switch:
ls -d *ro*
You could use :
ls | grep ro
To accomplish the task.
Pipe the output of ls which outputs only the contents of the current directory to grep and to selectively output the files matching the regex pattern.
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
4 years ago