chmod: cannot access 'file' : No such file or directory error when the file exists

  • I downloaded and saved 2 files on Linux tails live os. I have set the appropriate permissions on those 2 files to allow them as executable. This is the command I used.

    sudo chmod 777 home/amnesia/Desktop/file
    sudo chmod 777 file

    However, when I try to access these 2 files, both the files yield me an error as cannot access.

    I am not sure why it isn't recognizing the file permissions correctly.

  • Hackaholic

    Hackaholic Correct answer

    6 years ago

    this to:

    sudo chmod 777 home/amnesia/Desktop/file


    sudo chmod 777 /home/amnesia/Desktop/file

    you left a '/' slash

    better to use will be:

    sudo chmod 777 ~/Desktop/file

    Doesn't seem to work

    @hodurrr whats the output of `echo $HOME`. tell me

    what is the location of file, if you download it may be in download folder instead of Desktop

    The output is /home/amnesia and the location of the file is also /home/amnesia

    @hodurrr then do this `sudo chmod 777 ~/file`

    I did that and I didn't get any output (no error message, nothing). Does that mean it worked?

    yes it worked not error , if you give `ls -l file`, you will get `-rwx-rwx-rwx` in begning. it worked you can accept my solution

License under CC-BY-SA with attribution

Content dated before 6/26/2020 9:53 AM