LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-01-2006, 09:10 AM   #1
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: Ubuntu 18.04.3 LTS
Posts: 539

Rep: Reputation: 30
directory permissions


I am a bit confused by "." and ".."

Suppose i do this:

# ls -l
drwxr-xr-x 86 root root 7520 2006-01-01 07:57 ..
drwxrwxr-x 2 root root 336 2005-05-03 10:59 mydir

It shows the access mode / permissions for the directory 'mydir'
so then i go into mydir and look at the permissions:

# cd mydir
# ls -l
drwxrwxr-x 2 root root 336 2005-05-03 10:59 .
drw-r--r-- 4 root root 360 2005-05-03 10:20 ..
-rw-r--r-- 1 root root 936 2005-04-28 13:05 myfile

I would expect permissions of .. to match those of mydir, but they do not.

How would I change .. to match mydir?
 
Old 01-01-2006, 09:28 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
In a listing, "." is the current directory, and ".." is one up.

For example, if you are in /home/fred, and you want to be in /home, you type "cd .." To go up 2 levels" "cd ../.." To go across to /home/mary: "cd ../mary"

"cd ." of course does nothing.

Sooo--to change permissions for "." and "..", simply change the actual directories to which they refer.

The only practical use for "." that I have seen is the "execute here" construct "./program", which tells the system to execute "program" in this directory--don't go looking in $PATH.
 
Old 01-01-2006, 12:04 PM   #3
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: Ubuntu 18.04.3 LTS
Posts: 539

Original Poster
Rep: Reputation: 30
thanks

)))))))))))))
 
Old 01-01-2006, 02:43 PM   #4
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
Quote:
Originally Posted by allelopath
drw-r--r-- 4 root root 360 2005-05-03 10:20 ..
This is very bad. A directory is absolutely useless without execute permission. It is execute permission which allows you to access the contents of the directory.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
New directory permissions Paulsuk Linux - General 3 05-18-2005 06:36 AM
Directory Permissions Help artielnx Linux - Newbie 4 07-28-2004 02:25 PM
Directory permissions mephitic Linux - Security 3 04-12-2004 12:51 AM
write permissions for directory - not accidently move/deleted the directory linuxgamer Linux - Newbie 10 12-02-2003 03:04 AM
directory permissions odious1 Linux - Networking 3 07-15-2003 02:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:25 PM.

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
Open Source Consulting | Domain Registration