I recently took a midterm in my Linux class and this one command is bothering me because I thought I had it right.
My question is how would I go about finding all files and folders that start with either an uppercase or lowercase R?
I recently took a midterm in my Linux class and this one command is bothering me because I thought I had it right.
My question is how would I go about finding all files and folders that start with either an uppercase or lowercase R?
Assuming you want to search from the root of the file system located at / then I would suggest running the find command such as this
find / -iname "r*"
The command work as followed:
You could also add an -ls at the end to get a listing of the results. If you don't add an ls you just get the path to the result.
Is this what you are after?
Read man find
and man 7 regex
, then do something like:
find / \( -type d -o -type f \) -iname 'r*'
-name
and -iname
use shell globs? directing the OP to the regex
manpage is likely to sow confusion
Mar 2, 2018 at 17:29