Can I exclude a range of characters?

091

Yes, you can exclude a range of characters using the ! (exclamation mark) within square brackets [].

For example, to exclude all lowercase letters from a to f, you can use:

ls [!a-f]*.txt

This command will list all .txt files that do not start with any lowercase letter from a to f.

Similarly, if you want to exclude a range of uppercase letters, you can do:

ls [!A-F]*.txt

This will match all .txt files that do not start with any uppercase letter from A to F.

Feel free to ask if you have more questions!

0 Comments

no data
Be the first to share your comment!