Somehow an entire directory got changed into binary files, including my folders

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
2
down vote

favorite












Totally new to linux - trying to learn it as I'm a PHP developer. I was having some issues with wordpress and in trying to fix them my permissions got out of whack for my /var/www/html folder, to the point where I had to launch Atom using sudo atom just so I could write to my files. Today I tried to fix the issue, and honestly I don't understand the linux permission system whatsoever, so I just turned to Google. I found a recommendation to use:



sudo chmod 766 -R /var/www/html


I used that, and now everything in the html directory has been changed to a binary file (Binary (application/octet-stream)). All of the folders have been changed to binary files with the same name as before and all of the files that were inside of those folders are nowhere to be found. Is there any way to recover these files?










share|improve this question



















  • 3




    It's almost always a bad idea to use chmod -R, particularly with an insane mode like 766. Fix the permissions and see if that resolves the problem. I'd imagine you could use mode 644 for regular files and mode 755 for directories.
    – Chai T. Rex
    Mar 8 at 1:18










  • Maybe your wordpress got hacked you are ramsoned?
    – davidbaumann
    Mar 8 at 8:04










  • Could you please add the output of sudo ls -l /var/www/html to your question ?
    – Soren A
    Mar 8 at 8:58










  • I guess you see application/octet-stream because you are owner of these files and you set all of them to executeable (766)... in regards to "ll of the files that were inside of those folders are nowhere to be found" I guess nautilusmight have a problem with that? try to navigate on the commandline
    – Robert Riedl
    Mar 8 at 11:30














up vote
2
down vote

favorite












Totally new to linux - trying to learn it as I'm a PHP developer. I was having some issues with wordpress and in trying to fix them my permissions got out of whack for my /var/www/html folder, to the point where I had to launch Atom using sudo atom just so I could write to my files. Today I tried to fix the issue, and honestly I don't understand the linux permission system whatsoever, so I just turned to Google. I found a recommendation to use:



sudo chmod 766 -R /var/www/html


I used that, and now everything in the html directory has been changed to a binary file (Binary (application/octet-stream)). All of the folders have been changed to binary files with the same name as before and all of the files that were inside of those folders are nowhere to be found. Is there any way to recover these files?










share|improve this question



















  • 3




    It's almost always a bad idea to use chmod -R, particularly with an insane mode like 766. Fix the permissions and see if that resolves the problem. I'd imagine you could use mode 644 for regular files and mode 755 for directories.
    – Chai T. Rex
    Mar 8 at 1:18










  • Maybe your wordpress got hacked you are ramsoned?
    – davidbaumann
    Mar 8 at 8:04










  • Could you please add the output of sudo ls -l /var/www/html to your question ?
    – Soren A
    Mar 8 at 8:58










  • I guess you see application/octet-stream because you are owner of these files and you set all of them to executeable (766)... in regards to "ll of the files that were inside of those folders are nowhere to be found" I guess nautilusmight have a problem with that? try to navigate on the commandline
    – Robert Riedl
    Mar 8 at 11:30












up vote
2
down vote

favorite









up vote
2
down vote

favorite











Totally new to linux - trying to learn it as I'm a PHP developer. I was having some issues with wordpress and in trying to fix them my permissions got out of whack for my /var/www/html folder, to the point where I had to launch Atom using sudo atom just so I could write to my files. Today I tried to fix the issue, and honestly I don't understand the linux permission system whatsoever, so I just turned to Google. I found a recommendation to use:



sudo chmod 766 -R /var/www/html


I used that, and now everything in the html directory has been changed to a binary file (Binary (application/octet-stream)). All of the folders have been changed to binary files with the same name as before and all of the files that were inside of those folders are nowhere to be found. Is there any way to recover these files?










share|improve this question















Totally new to linux - trying to learn it as I'm a PHP developer. I was having some issues with wordpress and in trying to fix them my permissions got out of whack for my /var/www/html folder, to the point where I had to launch Atom using sudo atom just so I could write to my files. Today I tried to fix the issue, and honestly I don't understand the linux permission system whatsoever, so I just turned to Google. I found a recommendation to use:



sudo chmod 766 -R /var/www/html


I used that, and now everything in the html directory has been changed to a binary file (Binary (application/octet-stream)). All of the folders have been changed to binary files with the same name as before and all of the files that were inside of those folders are nowhere to be found. Is there any way to recover these files?







16.04






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 1:26









wjandrea

7,22342256




7,22342256










asked Mar 8 at 1:12









user393466

142




142







  • 3




    It's almost always a bad idea to use chmod -R, particularly with an insane mode like 766. Fix the permissions and see if that resolves the problem. I'd imagine you could use mode 644 for regular files and mode 755 for directories.
    – Chai T. Rex
    Mar 8 at 1:18










  • Maybe your wordpress got hacked you are ramsoned?
    – davidbaumann
    Mar 8 at 8:04










  • Could you please add the output of sudo ls -l /var/www/html to your question ?
    – Soren A
    Mar 8 at 8:58










  • I guess you see application/octet-stream because you are owner of these files and you set all of them to executeable (766)... in regards to "ll of the files that were inside of those folders are nowhere to be found" I guess nautilusmight have a problem with that? try to navigate on the commandline
    – Robert Riedl
    Mar 8 at 11:30












  • 3




    It's almost always a bad idea to use chmod -R, particularly with an insane mode like 766. Fix the permissions and see if that resolves the problem. I'd imagine you could use mode 644 for regular files and mode 755 for directories.
    – Chai T. Rex
    Mar 8 at 1:18










  • Maybe your wordpress got hacked you are ramsoned?
    – davidbaumann
    Mar 8 at 8:04










  • Could you please add the output of sudo ls -l /var/www/html to your question ?
    – Soren A
    Mar 8 at 8:58










  • I guess you see application/octet-stream because you are owner of these files and you set all of them to executeable (766)... in regards to "ll of the files that were inside of those folders are nowhere to be found" I guess nautilusmight have a problem with that? try to navigate on the commandline
    – Robert Riedl
    Mar 8 at 11:30







3




3




It's almost always a bad idea to use chmod -R, particularly with an insane mode like 766. Fix the permissions and see if that resolves the problem. I'd imagine you could use mode 644 for regular files and mode 755 for directories.
– Chai T. Rex
Mar 8 at 1:18




It's almost always a bad idea to use chmod -R, particularly with an insane mode like 766. Fix the permissions and see if that resolves the problem. I'd imagine you could use mode 644 for regular files and mode 755 for directories.
– Chai T. Rex
Mar 8 at 1:18












Maybe your wordpress got hacked you are ramsoned?
– davidbaumann
Mar 8 at 8:04




Maybe your wordpress got hacked you are ramsoned?
– davidbaumann
Mar 8 at 8:04












Could you please add the output of sudo ls -l /var/www/html to your question ?
– Soren A
Mar 8 at 8:58




Could you please add the output of sudo ls -l /var/www/html to your question ?
– Soren A
Mar 8 at 8:58












I guess you see application/octet-stream because you are owner of these files and you set all of them to executeable (766)... in regards to "ll of the files that were inside of those folders are nowhere to be found" I guess nautilusmight have a problem with that? try to navigate on the commandline
– Robert Riedl
Mar 8 at 11:30




I guess you see application/octet-stream because you are owner of these files and you set all of them to executeable (766)... in regards to "ll of the files that were inside of those folders are nowhere to be found" I guess nautilusmight have a problem with that? try to navigate on the commandline
– Robert Riedl
Mar 8 at 11:30










1 Answer
1






active

oldest

votes

















up vote
-1
down vote













I'm not going to pretend to know anything about Linux permissions or why this happened, but per advice in the comments I tried resetting all of the permissions for /var/. I used the step-by-step guide here and it totally fixed the issue - my files are back. Thanks!






share|improve this answer




















  • Don't use answers to add comments. Update your question with relevant new information, or add a comment.
    – Soren A
    Mar 8 at 6:48










  • @SorenA I'm not going to say you are wrong, but the website has a button that clearly says "Answer Your Own Question." I posted a question here, and I found the answer and linked to the steps I used. If you have an issue with my use of that button for exactly what it says, take it up with the design team.
    – user393466
    Mar 8 at 18:19










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1012911%2fsomehow-an-entire-directory-got-changed-into-binary-files-including-my-folders%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
-1
down vote













I'm not going to pretend to know anything about Linux permissions or why this happened, but per advice in the comments I tried resetting all of the permissions for /var/. I used the step-by-step guide here and it totally fixed the issue - my files are back. Thanks!






share|improve this answer




















  • Don't use answers to add comments. Update your question with relevant new information, or add a comment.
    – Soren A
    Mar 8 at 6:48










  • @SorenA I'm not going to say you are wrong, but the website has a button that clearly says "Answer Your Own Question." I posted a question here, and I found the answer and linked to the steps I used. If you have an issue with my use of that button for exactly what it says, take it up with the design team.
    – user393466
    Mar 8 at 18:19














up vote
-1
down vote













I'm not going to pretend to know anything about Linux permissions or why this happened, but per advice in the comments I tried resetting all of the permissions for /var/. I used the step-by-step guide here and it totally fixed the issue - my files are back. Thanks!






share|improve this answer




















  • Don't use answers to add comments. Update your question with relevant new information, or add a comment.
    – Soren A
    Mar 8 at 6:48










  • @SorenA I'm not going to say you are wrong, but the website has a button that clearly says "Answer Your Own Question." I posted a question here, and I found the answer and linked to the steps I used. If you have an issue with my use of that button for exactly what it says, take it up with the design team.
    – user393466
    Mar 8 at 18:19












up vote
-1
down vote










up vote
-1
down vote









I'm not going to pretend to know anything about Linux permissions or why this happened, but per advice in the comments I tried resetting all of the permissions for /var/. I used the step-by-step guide here and it totally fixed the issue - my files are back. Thanks!






share|improve this answer












I'm not going to pretend to know anything about Linux permissions or why this happened, but per advice in the comments I tried resetting all of the permissions for /var/. I used the step-by-step guide here and it totally fixed the issue - my files are back. Thanks!







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 8 at 5:12









user393466

142




142











  • Don't use answers to add comments. Update your question with relevant new information, or add a comment.
    – Soren A
    Mar 8 at 6:48










  • @SorenA I'm not going to say you are wrong, but the website has a button that clearly says "Answer Your Own Question." I posted a question here, and I found the answer and linked to the steps I used. If you have an issue with my use of that button for exactly what it says, take it up with the design team.
    – user393466
    Mar 8 at 18:19
















  • Don't use answers to add comments. Update your question with relevant new information, or add a comment.
    – Soren A
    Mar 8 at 6:48










  • @SorenA I'm not going to say you are wrong, but the website has a button that clearly says "Answer Your Own Question." I posted a question here, and I found the answer and linked to the steps I used. If you have an issue with my use of that button for exactly what it says, take it up with the design team.
    – user393466
    Mar 8 at 18:19















Don't use answers to add comments. Update your question with relevant new information, or add a comment.
– Soren A
Mar 8 at 6:48




Don't use answers to add comments. Update your question with relevant new information, or add a comment.
– Soren A
Mar 8 at 6:48












@SorenA I'm not going to say you are wrong, but the website has a button that clearly says "Answer Your Own Question." I posted a question here, and I found the answer and linked to the steps I used. If you have an issue with my use of that button for exactly what it says, take it up with the design team.
– user393466
Mar 8 at 18:19




@SorenA I'm not going to say you are wrong, but the website has a button that clearly says "Answer Your Own Question." I posted a question here, and I found the answer and linked to the steps I used. If you have an issue with my use of that button for exactly what it says, take it up with the design team.
– user393466
Mar 8 at 18:19

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1012911%2fsomehow-an-entire-directory-got-changed-into-binary-files-including-my-folders%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491