• We did not send an email asking for donations - please read this post.

cat filename.txt results in error

vpicton

New Member
Joined
Jan 13, 2021
Messages
2
Reaction score
0
Credits
26
Trying to share a file in Apache fails (saved to //var/www/html/somefile.txt
I can't use the command 'cat somefile.txt', it just doesn't work in any directory and throws a cat: no such file or directory error
I can touch the file, but then I can't modify it even as root because it throws an access denied error
With Apache2 running I can't access the file from my local machine using http://127.0.0.1/somefile.txt (having changed permissions to it and edited it), I get Forbidden
 


jglen490

Well-Known Member
Joined
Mar 10, 2020
Messages
736
Reaction score
505
Credits
4,106
First, I'm guessing the // you show with the filename reference is simply a typo.

Second, since typically /var is not in your default path, cat doesn't know where to find anything under /var. You can try "cat /var/www/html/somefile.txt", and that should give you output.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Top