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*
Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).
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 Stack Exchange
2 years ago