Results 1 to 4 of 4

Thread: Ubuntu (Linux) Chmod using octal notation

  1. #1
    Join Date
    Mar 2013

    Ubuntu (Linux) Chmod using octal notation

    I have ran a command using chmod ( change mode) in Ubuntu trying to get the permissions results

    when I type " chmod 755 testfile" into gmone terminal

    The results was " total 0". I was expecting to see somethings like this " -rwxr-xr-x 1 femi femi 0 2010-10-09 19:15 testfile".

    Can you please explain why and what I need to do to get the permissions ( -rwxr-xr-x) appears

  2. #2
    Join Date
    Jun 2007
    Porirua, New Zealand

    Re: Ubuntu (Linux) Chmod using octal notation

    Thread moved to General Help.
    I've moved your question to its own thread, because it doesn't appear to be directly related to the thread in which you originally posted it.

    If you want to read up on file permissions, you might find the following interesting:
    Forum DOs and DON'Ts
    Please use CODE tags
    Including your email address in a post is not recommended
    My Blog

  3. #3
    Join Date
    Apr 2011
    Mystletainn Kick!

    Re: Ubuntu (Linux) Chmod using octal notation

    Where are you in the directory?
    total 0 means you're sitting in an empty directory. Which is why it shows 0, nothing is in it.

    You can run:
    which will tell you where you are currently sitting in terms of directories.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful

  4. #4
    Join Date
    Oct 2009
    Elgin, IL USA
    Ubuntu 16.10 Yakkety Yak

    Re: Ubuntu (Linux) Chmod using octal notation

    Your syntax is correct assuming you were in the directory (with typical rwx permission for you or your group) containing testfile. If it was not successful or the file did not exist, you should have gotten an error from chmod.

    Were you doing this on a Linux or non-Linux file system? You cannot set permissions for individual files or directories on FAT or ntfs file systems (only blanket permissions on all directories and/or files based on mount options)

    efflandt@XPS8100-1204:~$ ls -l testfile
    ls: cannot access testfile: No such file or directory
    efflandt@XPS8100-1204:~$ touch testfile && chmod 755 testfile
    efflandt@XPS8100-1204:~$ ls -l testfile
    -rwxr-xr-x 1 efflandt efflandt 0 Mar 10 23:41 testfile
    chmod +x testfile would work as well, but since by default files in your home directory are owned by you and your own group, would end up with -rwxrwxr-x
    i5 650 3.2 GHz upgraded to i7 870, 16 GB 1333 RAM, nvidia GTX 1060, 32" 1080p & assorted older computers


Posting Permissions

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