Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Permission Please to Read?

    Probably something simple I am missing but basically why will nano read the file and a small cat script (rme) not? Script at bottom.

    Copied rme to root. Changed own and group of rme. At no time would it read ufw.log. Why does nano read it and rme does not?

    -rwxr-xr-x 1 root root 51856 Jan 26 2013 /bin/cat
    -rwxr-xr-x 1 root root 192504 Jun 22 2012 /bin/nano
    -rwxr-xr-x 1 root root 41 Apr 29 09:45 rme
    -rw-r----- 1 root root 5583 Apr 29 09:22 ufw.log
    cat /home/coot/Desktop/ufw.log

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Tucson AZ
    -rw-r----- 1 root root 5583 Apr 29 09:22 ufw.log
    I expect it is because the owner:group for that file is root:root and you are running it as a normal user. A normal user is not root and not a member of the group root. Changing the permissions on ufw.log to 644 would give 'others' read permission. I created a ufw.log text file on my Deskktop and entered a single line before changing permissions and got no output. After changing permissions, I could read it with cat.

  3. #3
    Thank you for the reply. What I was wondering about is 'nano'. Why is it able to read the file and my cat script not? Everything that I see is equal? As a user not root I can run nano on the file and it will pull it up. As a user the 'rme' cat script will not?

  4. $spacer_open
  5. #4

    If you change

    Quote Originally Posted by Zedo View Post


    Quote Originally Posted by Zedo View Post
    cat /home/coot/Desktop/ufw.log

    -c "cat /home/coot/Desktop/ufw.log"

    I think that you got this issue because sh does not seems to "guess" what to do or where to do it. See the stdin section of this link for more informations.

    Bash can run most sh scripts without modification. -- tldp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts