How to query the AppleShowAllFiles status of com.apple.Finder?

want to write a .command file to quickly switch whether to display the full file.

you usually need to knock one line at a time

defaults write com.apple.Finder AppleShowAllFiles YES(NO) && killAll Finder

is there any way to query the status of AppleShowAllFiles to quickly switch over if then?

Apr.16,2022

CMD + Shift +.

you can quickly switch whether to show hidden files

Menu