Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-29-2011, 01:47 AM   #1
Registered: Oct 2005
Location: Bangladesh
Posts: 497

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
Registered: Oct 2010
Location: Liège, Belgium
Distribution: Debian & co
Posts: 51
Blog Entries: 1

Rep: Reputation: 9
you should have a look at umask (man umask or for instance)

Last edited by T0sh1r0; 03-29-2011 at 01:56 AM.
Old 03-29-2011, 10:10 AM   #3
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!


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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:55 AM.

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