Answer the question
In order to leave comments, you need to log in
How to display a list of files in a directory whose name starts with the given characters?
What parameters of the ls command should be used to list the files in a directory whose name starts with the given characters (letters)?
Answer the question
In order to leave comments, you need to log in
The command is called ls .
She has no such options.
But if you've seen something like ls a* somewhere, it will most likely work as you want, not because ls is so smart, but because your shell has replaced a* with a list of files starting with a . You might as well write echo a* and see the same list.
You can write
ls | grep ^[abc]
Print to the console all files in the current directory that start with a,b or c
or
ls | grep ^abc
- print all files that start with abc
There is no option for regular expressions in ls itself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question