0

I can use:

for f in .* ; do [ -f $f ] && openssl aes-256-cbc -in $f -out $f -k PASSWORD ; done

to encrypt all hidden files in a folder and use:

for f in * ; do [ -f $f ] && openssl aes-256-cbc -in $f -out $f -k PASSWORD ; done

to encrypt all visible files in a folder. Is it possible to combine these two commands? And are there other potential types of files that are not matched by * and .*?

kbulgrien
  • 830
Aero Wang
  • 161

1 Answers1

0

I use the && thing:

for f in .* ; do [ -f $f ] && openssl aes-256-cbc -in $f -out $f -k PASSWORD ; done && for f in * ; do [ -f $f ] && openssl aes-256-cbc -in $f -out $f -k PASSWORD ; done

Ex. echo 1 && echo 2 returns

1

2