LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-29-2011, 01:47 AM   #1
shipon_97
Member
 
Registered: Oct 2005
Location: Bangladesh
Posts: 447

Rep: Reputation: 30
file permission !!!


Dear Friends ,

I have a following little query :

First in linux environment, I create a folder 'test' and give it 755 permission. Now I want a situation , when I create a subfolder as well as a file then it gets same 755 permission (permission folloed the above folder always) .

>[root@apps ~]#mkdir test
>[root@apps ~]# ls -l|grep test
>drwxr-xr-x 2 root root 4096 Mar 29 12:31 test
>[root@apps ~]# mkdir folder
>[root@apps ~]# cd test/
>[root@apps test]# mkdir folder
>[root@apps test]# touch file1
>[root@apps test]# ls -l
>total 4
>-rw-r--r-- 1 root root 0 Mar 29 12:32 file1
>drwxr-xr-x 2 root root 4096 Mar 29 12:32 folder


Here I got the 'folder' permission 755 but 'file1' permission is not 755 . How can I get 755 permission of 'file1' ?

Barring this when I copy a file from another place to this 'folder' then also I want to get same permission (755) of that file .

plz help me ... ...

Last edited by shipon_97; 03-29-2011 at 01:49 AM.
 
Old 03-29-2011, 01:55 AM   #2
T0sh1r0
Member
 
Registered: Oct 2010
Location: Liège, Belgium
Distribution: Debian / Slackware
Posts: 47
Blog Entries: 1

Rep: Reputation: 7
you should have a look at umask (man umask or http://en.wikipedia.org/wiki/Umask) for instance)

Last edited by T0sh1r0; 03-29-2011 at 01:56 AM.
 
Old 03-29-2011, 10:10 AM   #3
16pide
Member
 
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
the difference in rights that you get between your directory and your file can be explained this way:

a folder needs to have execution right to let you read what is in it. So by default you get this x

when a file has the execution right, it means it's a program or a script, and you can run it. So by default you don't get the "x" in the rights of files. This is a security protection.

You could run chmod a+x *
But I certainly don't recommend it!
 
  


Reply

Tags
chmod, file permission, umask


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
Wrong file permission when I copy a file henrik9 Linux - Newbie 2 10-18-2010 05:51 AM
Any log file for checking file permission change history in RHEL 5.1? bilalcochin Linux - Newbie 3 04-02-2010 09:57 AM
regarding file permission for db2 backup image file lx4all Linux - General 1 12-13-2007 03:37 PM
Changing file permission, How to edit a file? rainchild Linux - Newbie 8 01-14-2007 10:18 PM
change file permission of a mouse device file permanently alexandre_fs Linux - General 5 01-09-2007 06:30 AM


All times are GMT -5. The time now is 06:33 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration