I have the following bash command:
$(ls -l /var/ | grep www) > cat folder_exists
but it is not working properly. What I hope to achieve is a command, that checks to see if there is a www folder located inside the /var/
folder, and prints the result of that particular command to the file folder_exists
. I have also tried to retype the command numerous times, example given
cat $(ls -l /var/ | grep www) > folder_exists
or even
cat $(ls -l /var | grep www) > folder_exists
just in case that slash did the damage, but to no avail.
My problem is that even though I am creating the file folder_exists
, I fail to print the output to it. Could somebody please show me where I have gone wrong?