0

is there a problem with my Linux distribution? i tried to run this command using the ! symbol,but it always display an error:

echo .[!.]*  
zsh: event not found: .

Am using Kali Linux.

slinger
  • 140
  • 1
  • 2
  • 7
  • As alternative to the solution given by chepner: If you don't plan to use history expansion at all, you can also (in your .zshrc) turn it off by `setopt nobanghist` and then don't need to worry about escaping the `!`. – user1934428 Oct 15 '21 at 13:55

1 Answers1

3

Either escape the !

echo .[\!.]*

or use ^ instead

echo .[^.]*

Both avoid unintentionally triggering history expansion.

chepner
  • 497,756
  • 71
  • 530
  • 681