Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: beginners question about permissions?

  1. #1
    Join Date
    Jan 2009
    Beans
    65

    beginners question about permissions?

    One of the things I dont quite understand is Permissions. Well I sort of do (emphasis on sort of here!) Theres a tutorial on Psychocats but that comes more from the command line perspective. Here's what I cant figure out and want to do:

    In the /home/"user name"/examples directory there are a pile of example files that I'd like to delete. I cant delete them as they are root permission and if I go to properties it wont let me change the permissions as "I'm not the owner"

    So how do I change the permissions? I'd like to know how to do this by both the command line AND on the GUI if possible.

    Many thanks
    Mike
    Hardy 8.04
    Compaq Presario M2000 Notebook

  2. #2
    Join Date
    Jun 2007
    Location
    Poughkeepsie, NY
    Beans
    5,810
    Distro
    Ubuntu

    Re: beginners question about permissions?

    there is no way to do it from the GUI, sorry at leat not in Ubuntu (you canot log in with Root)
    from a gnome terminal
    Code:
    gksu nautilus
    it will open the file manager with root access... what ever you delete will be gone forever, be careful

  3. #3
    Join Date
    Oct 2005
    Location
    Jacksonville, FL
    Beans
    29,420

    Re: beginners question about permissions?

    In this case, change the ownership of those files from root to your login name would allow you to do whatever you want with those files, deleting them if you wish.

    Code:
    cd ~/examples
    sudo chown username *
    Replace username with your login name.

    Or delete them with root privilege.

    Code:
    cd ~/examples
    sudo rm *
    In the world of Linux, who needs Windows and Gates...

    Got most of my golden beans at an auction on eBay (with a couple of free drinks).

  4. #4
    Join Date
    Apr 2006
    Location
    Dallas, TX
    Beans
    1,359
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: beginners question about permissions?

    If those example files accidentally got owned by root, the easiest way to deal with it in a GUI is to start nautilus with gksudo. Ironically, this has to be done with the commandline. Press ALT+F2 or go to Applications > Accessories > Terminal and type:
    Code:
    gksudo nautilus
    enter your password when asked, and a file manager window owned by root should show up. Now just browse to /home/username and you can delete those example files.

    Alternatively, you can do it all from the commandline. Open a terminal and you should be in your home directory. Now you can use
    Code:
    sudo chown username exampleFile
    to change the ownership of exampleFile to your account. Then use rm to remove the files.

    For more information
    Code:
    man rm
    man chown
    man chgrp
    man chmod

  5. #5
    Join Date
    Apr 2007
    Beans
    3,114
    Distro
    Ubuntu

    Re: beginners question about permissions?

    "/home/"user name"/examples" is a symbolic link pointing to a common system directory where you do not have permissions. If you want to "customize" this directory:

    1) rename "examples" to "examples_old"
    2) Create a new directory "examples"
    3) Copy all files from "examples_old" to "examples"
    4) Delete "examples_old" (you are only deleting the link)
    5) Change "examples" to your heart's content.

  6. #6
    Join Date
    Oct 2008
    Location
    Cambridge, MA
    Beans
    41
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: beginners question about permissions?

    To change the permissions on the files you can use the 'chmod' command.

    There are several ways to use that command to change permissions for the owner, group, and others.

    One example is:
    Code:
    chmod 644 file
    This will give the owner read and write permissions, while the group and others will only have read-only permission.

    If you are not the owner, you'll have to add sudo to the beginning in order to overcome that.

    But taurus is correct in pointing out that you could just change ownership to remove them.

  7. #7
    Join Date
    Jan 2009
    Beans
    65

    Re: beginners question about permissions?

    Quote Originally Posted by taurus View Post
    In this case, change the ownership of those files from root to your login name would allow you to do whatever you want with those files, deleting them if you wish.

    Code:
    cd ~/examples
    sudo chown username *
    Replace username with your login name.

    Or delete them with root privilege.

    Code:
    cd ~/examples
    sudo rm *
    OK thanks everyone. Lots to digest here..I do appreciate your advice/comments!

    But when I enter what taurus said into terminal I get this. Why?

    "mbdb@M2000:~$ cd ~/examples
    bash: cd: /home/mbdb/examples: No such file or directory
    mbdb@M2000:~$
    Hardy 8.04
    Compaq Presario M2000 Notebook

  8. #8
    Join Date
    Jan 2009
    Beans
    65

    Re: beginners question about permissions?

    Quote Originally Posted by LowSky View Post
    there is no way to do it from the GUI, sorry at leat not in Ubuntu (you canot log in with Root)
    from a gnome terminal
    Code:
    gksu nautilus
    it will open the file manager with root access... what ever you delete will be gone forever, be careful
    OK that worked pretty slick. Yes Ill be very careful but I dont think I need things like boring music clips or "fables"

    Thanks
    Hardy 8.04
    Compaq Presario M2000 Notebook

  9. #9
    Join Date
    Oct 2008
    Location
    Cambridge, MA
    Beans
    41
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: beginners question about permissions?

    Quote Originally Posted by casmok View Post
    But when I enter what taurus said into terminal I get this. Why?

    "mbdb@M2000:~$ cd ~/examples
    bash: cd: /home/mbdb/examples: No such file or directory
    mbdb@M2000:~$
    You get that because the directory "/home/mbdb/examples" does not exist. The "~" just defines your home directory. Wherever your examples folder is is what you need to cd into.

    I'm guessing that your mistake is a case-sensitivity one. Remember, case matters in linux. Examples is not the same as examples

    Try this:
    Code:
    cd ~/Examples
    Should work this time

  10. #10
    Join Date
    Oct 2005
    Location
    Jacksonville, FL
    Beans
    29,420

    Re: beginners question about permissions?

    Quote Originally Posted by casmok View Post
    OK thanks everyone. Lots to digest here..I do appreciate your advice/comments!

    But when I enter what taurus said into terminal I get this. Why?

    "mbdb@M2000:~$ cd ~/examples
    bash: cd: /home/mbdb/examples: No such file or directory
    mbdb@M2000:~$
    Where is that directory?

    Code:
    ls -la ~
    In the world of Linux, who needs Windows and Gates...

    Got most of my golden beans at an auction on eBay (with a couple of free drinks).

Page 1 of 2 12 LastLast

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
  •