Skip to main content
missing -d and -- when using globs, those globs are also supported by zsh when in ksh emulation, though zsh has its own ^*bak for that.
Source Link
Stéphane Chazelas
  • 584.9k
  • 96
  • 1.1k
  • 1.7k

If you use ksh (or bash with extended globbing activated, or zsh with ksh globs enabled) you can achieve the desired function using only file globbing patterns:

ls -d -- !(*bak)

With grep, to get a simple solution, just use the negation -v:

ls | grep -v 'bak$'

If you use ksh (or bash with extended globbing activated) you can achieve the desired function using only file globbing patterns:

ls !(*bak)

With grep, to get a simple solution, just use the negation -v:

ls | grep -v 'bak$'

If you use ksh (or bash with extended globbing activated, or zsh with ksh globs enabled) you can achieve the desired function using only file globbing patterns:

ls -d -- !(*bak)

With grep, to get a simple solution, just use the negation -v:

ls | grep -v 'bak$'
Link to extended globbing
Source Link
l0b0
  • 53.6k
  • 48
  • 225
  • 398

If you use ksh (or bash with extended globbingextended globbing activated) you can achieve the desired function using only file globbing patterns:

ls !(*bak)

With grep, to get a simple solution, just use the negation -v:

ls | grep -v 'bak$'

If you use ksh (or bash with extended globbing activated) you can achieve the desired function using only file globbing patterns:

ls !(*bak)

With grep, to get a simple solution, just use the negation -v:

ls | grep -v 'bak$'

If you use ksh (or bash with extended globbing activated) you can achieve the desired function using only file globbing patterns:

ls !(*bak)

With grep, to get a simple solution, just use the negation -v:

ls | grep -v 'bak$'
added 100 characters in body
Source Link
Janis
  • 14.4k
  • 4
  • 28
  • 42

If you use ksh (or bash with extended globbing activated) you can achieve thisthe desired function using only file globbing patterns:

ls !(*bak)

With grep it's for example, to get a simple solution, just use the negation -v:

ls | grep -v 'bak$'

If you use ksh you can achieve this using only file globbing patterns:

ls !(*bak)

With grep it's for example:

ls | grep -v 'bak$'

If you use ksh (or bash with extended globbing activated) you can achieve the desired function using only file globbing patterns:

ls !(*bak)

With grep, to get a simple solution, just use the negation -v:

ls | grep -v 'bak$'
Source Link
Janis
  • 14.4k
  • 4
  • 28
  • 42
Loading