LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-04-2015, 06:58 PM   #1
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 447

Rep: Reputation: 28
Do you have to have execute on a directory to be able to view contents in it?


hi guys im a little confused

read privilege on a directory means i can list the contents
write means i can save,edit and delete files in that directory
but then it says execute is like a light switch,if its off (no execute) you will not be able to view items in the directory

so do you have to have rwx on a directory to be able to use it fully?
if you have rw- as the owner will you not be able to view or change
into subdirectories within that directory?
 
Old 03-04-2015, 07:05 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 7,002

Rep: Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520
Yes
 
Old 03-04-2015, 07:29 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 3,876
Blog Entries: 1

Rep: Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997
Yes. Although it occupies the 'execute' bit location and is shown as 'x' in most listing tools, it is not actually 'execute' in directory context.

Think about it - you cannot 'execute' a directory - it must mean something else!

It is often called the 'traversal' or 'cross' bit in some Unix texts - cross fitting well with the 'x' symbol.

What it means is that you can read meta data from within the directory, effectively meaning that you can traverse, or cross the directory boundary.

But alas, everyone does still call it the execute bit.

Last edited by astrogeek; 03-04-2015 at 07:30 PM.
 
Old 03-04-2015, 08:01 PM   #4
Miati
Member
 
Registered: Dec 2014
Distribution: Linux Mint 17.*
Posts: 326

Rep: Reputation: 106Reputation: 106
I perceive it to be execute because directories are a special kind of file, but a file still.
the execute permits executing of code which is likely nothing more then pointing names to inode locations

Could be I'm way off, but it helps me to understand :P
 
Old 03-04-2015, 08:56 PM   #5
Fred Caro
Member
 
Registered: May 2007
Posts: 999

Rep: Reputation: 166Reputation: 166
I look at it this way, to open a directory you have to 'execute' it and so you have performed an action on it but you have n't writen to it because this inode/file is just a container.

Fred.
 
Old 03-05-2015, 12:45 AM   #6
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by sigint-ninja View Post
hi guys im a little confused

read privilege on a directory means i can list the contents
write means i can save,edit and delete files in that directory
but then it says execute is like a light switch,if its off (no execute) you will not be able to view items in the directory

so do you have to have rwx on a directory to be able to use it fully?
if you have rw- as the owner will you not be able to view or change
into subdirectories within that directory?
If you remove execute perm but still have read perm on dir then you can't get file metadata content. But you can list the names of all files present in it.
 
Old 03-05-2015, 03:16 PM   #7
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 447

Original Poster
Rep: Reputation: 28
as always, thanks guys...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tape contents view Ammad Linux - General 1 09-23-2008 08:57 AM
unable to view the contents!!! a1ora0 Slackware 1 09-29-2007 01:58 PM
list contents of directory without listing contents baddah Linux - Newbie 2 06-12-2006 05:02 AM
How to view memory contents rockinsky Linux - Software 3 05-11-2006 06:09 PM
how to view contents of cd Synth218 Linux - Newbie 7 05-25-2003 07:34 PM


All times are GMT -5. The time now is 11:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration