Search code examples
linuxshellgrepls

List files which have 'c' as second letter (Linux)


How can I do that? Do I have to use regular expressions?

To clarify, let's say I have the following files in a directory: abc.sh acb.sh example.c bob.php - and I want to list the ones which has 'c' as second letter (i.e. acb.sh).

Thanks!


Solution

  • If you are working in the shell

    ls ?c*
    

    is all that it takes.