how to fix Permission denied on directory in unix?

37,450

Solution 1

Use this command in command line tool

chmod 0777 /tmp/f.zip

Solution 2

if you have ran your script as root and now as normal user. Then you may not have permission to read/write f.zip

Share:
37,450

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    I have a ksh file which will download a zip file from the internet in the /tmp directory with name f.zip

    Why do I get Permission denied?

    $ ./downloadbcfi
    Current name is /download.files.R1201BHtm.zip
    /tmp/f.zip: Permissin denied
    

    When I look at the permission on the /tmp directory everything is ok as below: enter image description here

    • Sjoerd
      Sjoerd about 12 years
      It could be because /tmp/f.zip already exists.
    • Oleg Mikheev
      Oleg Mikheev about 12 years
      tried to run script as root?
    • Wooble
      Wooble about 12 years
      Is the shell really spelling "permission" wrong, or is this not an actual copy and paste?
    • Admin
      Admin about 12 years
      You are right /tmp/f.zip already exists and i have not permission to write to it. thanks