Use ls to only list files that start with an uppercase character.

Posted: March 19, 2017. At: 6:47 PM. This was 6 months ago. Post ID: 10385

The ls command may be used in conjunction with grep to list files that start with an uppercase letter or have an uppercase filename.

ubuntu ~/Documents $ ls | grep "^[A-Z]"
SAM
SECURITY
SYSTEM

The ls command itself may also do this.


ubuntu ~/Documents $ ls [[:upper:]]*
SAM SECURITY SYSTEM

Or this very old command. This will use ls to list only uppercase files.

( shopt -s globasciiranges; /bin/ls [a-z]* )
alowercasefile

No comments have been made. Use this form to start the conversation :)

Leave a Reply