Use egrep-style extended pattern matching.
ls !(*.jar)
This is available starting with bash-2.02-alpha1.
Must first be enabled with
shopt -s extglob
As of bash-4.1-alpha there is a config option to enable this by default.
More Related Contents:
- What do double-asterisk (**) wildcards mean?
- What expands to all files in current directory recursively?
- What does the double-asterisk (**) wildcard mean?
- Test whether a glob has any matches in Bash
- How to loop over files in directory and change path and add suffix to filename
- Stop shell wildcard character expansion?
- How can I use inverse or negative wildcards when pattern matching in a unix/linux shell?
- In bash, how do I expand a wildcard while it’s inside double quotes?
- Listing only directories using ls in Bash?
- awk in bash with ls and variable
- How to skip the for loop when there are no matching files?
- Loop through all the files with a specific extension
- How can I get a recursive full-path listing, one line per file?
- Exclude a string from wildcard search in a shell
- How to assign a glob expression to a variable in a Bash script?
- Using SED with wildcard
- Loop over array, preventing wildcard expansion (*)
- Why does shell ignore quoting characters in arguments passed to it through variables? [duplicate]
- How can I use a file in a command and redirect output to the same file without truncating it?
- How to check if a variable is set in Bash
- Why does a space in a variable assignment give an error in Bash? [duplicate]
- What is a simple explanation for how pipes work in Bash?
- Indirect variable assignment in bash
- Shell script to delete directories older than n days
- How to recursively find the latest modified file in a directory?
- How to extract directory path from file path?
- Quick-and-dirty way to ensure only one instance of a shell script is running at a time
- What does the Bash operator
- Store output of sed into a variable [duplicate]
- How to redirect a program that writes to tty?