encryption - What mechanism allows linux less command to read an encrypted gpg file -


after encrypting file using symmetric encryption, decided confirm output encrypted typing:

gpg -c --force-mdc --s2k-mode 3 --s2k-count 65011712 --output doc.gpg doc.txt  less doc.gpg 

to astonishment, less command automatically decrypted contents of doc.gpg , displayed them me, rather displaying raw encrypted contents of file. happens "less" command , not "cat" command. if "less doc.gpg" done on different machine, command line popup dialog appear asking password.

could please explain mechanism causing gpg integrate automatically "less" command, , other commands automatic integration occur with? thanks!

start this:

$ man less 

read bit, , find:

input preprocessor

you may define "input preprocessor" less. before less opens file, first gives input preprocessor chance modify way contents of file displayed...

...to set input preprocessor, set lessopen environment variable command line invoke input preprocessor. command line should include 1 occurrence of string "%s", replaced filename when input preprocessor command invoked.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -