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

Posted: March 19, 2017. At: 6:47 PM. This was 9 months ago. Post ID: 10385
Page permalink.
WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters. These cookies expire two weeks after they are set.

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