Results 1 to 4 of 4

Thread: Ubuntu (Linux) Chmod using octal notation

  1. #1
    Join Date
    Mar 2013
    Beans
    1

    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
    Location
    Porirua, New Zealand
    Beans
    Hidden!
    Distro
    Ubuntu

    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:
    https://help.ubuntu.com/community/FilePermissions
    Forum DOs and DON'Ts
    Never assume that information you find using a search engine is up-to-date.

  3. #3
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    5,526
    Distro
    Ubuntu

    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:
    Code:
    pwd
    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
    Location
    Elgin, IL USA
    Beans
    2,807
    Distro
    Ubuntu 14.04 Trusty Tahr

    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)

    Code:
    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, 8 GB, nvidia GTX 750 Ti, 32" 1080p | i7-4700MQ, 8 GB, Intel HD 4600/nvidia GTX 765M, 15.6" 1080p | etc.

Bookmarks

Posting Permissions

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