Retrieving boolean values of System Properties (Terminal commands)
The read qualifier shows the value:

$ defaults write com.apple.finder AppleShowAllFiles 1

$ defaults read com.apple.finder AppleShowAllFiles
1

$ defaults write com.apple.finder AppleShowAllFiles 0

$ defaults read com.apple.finder AppleShowAllFiles
0


The man defaults Terminal command gives a wealth of information.