Results 1 to 10 of 10

Thread: listing files in terminal

  1. #1
    Join Date
    Jun 2008
    Beans
    33

    Question listing files in terminal

    Hi

    Maybe a simple thing for some but I need to change some permissions on a folder I created on another volume (not the boot volume).

    How do I change volumes so that I can list/change files etc in that volume?

    ian

  2. #2
    Join Date
    Jun 2007
    Location
    Portland, Oregon
    Beans
    270
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: listing files in terminal

    Simplest way:

    Code:
    sudo nautilus
    Browse for what you're looking for, right click it, go to Properties, and then change permissions from the Permissions tab.

    If you really want to do it through the command line, this takes you to a directory:
    Code:
    cd /PATHTODIRECTORY
    And this takes you up a level:
    Code:
    cd ..
    To list files in a directory, use:
    Code:
    ls -a
    Last edited by Dynaflow; June 20th, 2008 at 11:28 AM.

  3. #3
    Join Date
    Apr 2007
    Location
    Redmond, WA
    Beans
    1,371
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: listing files in terminal

    Quote Originally Posted by Dynaflow View Post
    Simplest way:
    Code:
    sudo nautilus
    When using root privileges with graphical applications it is recommend to use gksudo instead of sudo.

    More here. So, this would be the command.

    Code:
    gksudo nautilus

  4. #4
    Join Date
    Jun 2007
    Location
    Portland, Oregon
    Beans
    270
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: listing files in terminal

    Quote Originally Posted by wormser View Post
    When using root privileges with graphical applications it is recommend to use gksudo instead of sudo.

    More here. So, this would be the command.

    Code:
    gksudo nautilus
    So that's why. Interesting.

  5. #5
    Join Date
    Jun 2008
    Beans
    33

    Exclamation Re: listing files in terminal

    The nautilus line runs a gui with a file browser. Opening the volume with the folder in that I created and right clicking I get an option Properties, selecting that opens a dialogue with various tabs atop, including Permissions. Selecting Permissions tab displays three areas, Owner Group and Others with Folder and File options for each respectively.

    Owner says ians (my login)
    Folder Access: Create and Delete Files
    File Access: ----

    Group says root
    Folder Acess: none
    File Access: ----

    Others says <blank>
    Folder Access: ----
    File Access: ----

    Trying to change any of them does nothing, they just flick back to what they say above, clicking the button at the foot of that dialogue "Apply Permissions to Enclosed Files" just clears any choices I make above.

    Its all a bit strange I think as when I created the share on this folder I ticked the box that said "Guest Access" so I would have thought the "Others" would include read/write access for anyone.

    I may be barking up the wrong tree (or just plain barking, lol) being a beginner, but isn't there a command line thingy like chmod to change permissions I could use?

    I just dont know how to specify the volume name at the command prompt because it does not seem to recognise the "xxGb Media" label the GUI displays.

    I am probably asking the wrong questions, help!

    ian

    ps the object of the exercise was to make the folder read/write accessible to everyone on the local network.
    Last edited by ians1; June 20th, 2008 at 04:25 PM.

  6. #6
    Join Date
    Jan 2007
    Location
    West Sussex, UK
    Beans
    30
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: listing files in terminal

    Quote Originally Posted by ians1 View Post
    The nautilus line runs a gui with a file browser. Opening the volume with the folder in that I created and right clicking I get an option Properties, selecting that opens a dialogue with various tabs atop, including Permissions. Selecting Permissions tab displays three areas, Owner Group and Others with Folder and File options for each respectively.

    Owner says ians (my login)
    Folder Access: Create and Delete Files
    File Access: ----

    Group says root
    Folder Acess: none
    File Access: ----

    Others says <blank>
    Folder Access: ----
    File Access: ----

    Trying to change any of them does nothing, they just flick back to what they say above, clicking the button at the foot of that dialogue "Apply Permissions to Enclosed Files" just clears any choices I make above.

    Its all a bit strange I think as when I created the share on this folder I ticked the box that said "Guest Access" so I would have thought the "Others" would include read/write access for anyone.

    I may be barking up the wrong tree (or just plain barking, lol) being a beginner, but isn't there a command line thingy like chmod to change permissions I could use?

    I just dont know how to specify the volume name at the command prompt because it does not seem to recognise the "xxGb Media" label the GUI displays.

    I am probably asking the wrong questions, help!

    ian

    ps the object of the exercise was to make the folder read/write accessible to everyone on the local network.
    Ian,

    There is indeed a chmod command and it works by using three digits to represent the permissions. You can only chmod without using sudo when you are the owner (eg you are in your own home folder). The digits in order are for owner, group and everybody. The numbers are 4 for read, 2 for write and 1 for execute. Like this:

    Owner - Group - Everybody
    R-W-X - R-W-X - R-W-X
    4-2-1 - 4-2-1 - 4-2-1

    so, if you want to give RWX permissions to owner and Group and RW permissions to Everybody it would be:

    Owner - 4+2+1 = 7
    Group - 4+2+1 = 7
    Everybody - 4+2 = 6

    Therefore command would be "chmod 776 <path then filename>"

    Hope this helps....

    Gary.

  7. #7
    Join Date
    Jun 2008
    Beans
    33

    Exclamation Re: listing files in terminal

    How do I specify the path to another volume, like another disk as this is?

    ian

  8. #8
    Join Date
    Jun 2007
    Location
    Neverland
    Beans
    894
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: listing files in terminal

    Hello,

    In Linux, there's only one root. There are no separate volumes like in Windows C:, D: etc.

    Thus, you merely need to change to the desired directory:

    cd "dir-name"

    Cheers,
    Dedoimedo
    Linux Systems Expert / Systems Programmer, LPIC-1, LPIC-2(WIP), GSEC, CCHD, CCHA
    http://www.dedoimedo.com - A place to learn a lot about a lot!

    Pangolin Review | Ringtail Review | Linux Games | My books

  9. #9
    Join Date
    Jun 2008
    Beans
    33

    Question Re: listing files in terminal

    Still can't do it, just says

    Code:
    ians@ians-unix:/$ cd D_arc
    bash: cd: D_arc: No such file or directory
    but I can see it in the file browser

    ian

  10. #10
    Join Date
    Jun 2008
    Beans
    33

    Wink Re: listing files in terminal

    Its OK

    I found it

    Code:
    ians@ians-unix:/media/disk$ dir
    D_arc
    Its just a bit obscure because the file browser thingy lists volumes by name eg "100Gb Media" or "New Volume" which don't corespond to the /media/disk as above.

    ian

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
  •