I have a file which stores multiple file paths in the file content, as such:
JavaScript
x
$ cat /var/tmp/sample
/etc/ssl/example/ssl-test1.cert
/etc/ssl/example/ssl-test2.cert
/etc/ssl/example/ssl-test3.cert
Is there a single line command to loop the file paths in the file and set the permission for each of the file paths chmod 644 <file paths in /var/tmp/sample>
?
Advertisement
Answer
Another way to use xargs:
JavaScript
cat /var/tmp/sample | xargs -d 'n' chmod 644