April 25, 2024, 09:25:19 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: file permission  (Read 4304 times)

Offline deven_01

  • Linux Learner
  • ***
  • Posts: 143
file permission
« on: April 25, 2006, 05:36:55 AM »
Hello  friends
 I having confussion regarding to User Group and other
 r=4, w=2, x=1
 so total is 7
 when i had given chmod 333 /tmp/list.txt
 A list.txt is a file under my /tmp directory
 i got
 --wx-wx-wx like this
 When we say a file having write permission for group or user or other then it must have a read permission for all b'coz when you open file for write it readable
 So is it true or false if somebudy know abt it kindly reply back
 Regards
 Linux User

Offline sravanth.svk

  • Linux Noob !
  • *
  • Posts: 13
hi
« Reply #1 on: April 25, 2006, 09:23:36 AM »
to my knoledge
if u give the permission for read in the sence it is read only
and if u give write permission means it is write only  i..e,
u can only append
if there is any thing wrong plz inform
thank u all in advance

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
file permission
« Reply #2 on: April 27, 2006, 04:22:03 PM »
Hi all

Just keep in mind that u must take care of permissions of its parent direcory also

just create a file list.txt(from any user not root)  and write any thing to it like  write "Hello" in  that file

after that give 333 permission to ur file

then when u try to open this file..it will not show u the existing contents...as it is read only..., ya u can  write to it easily..,

Just try above things from any other user(NOT ROOT)

But as root is super user ,this is not valid for root user

And about directory inheritence permissions in case of file is quite confusing and lengthy topic,discuss it later


Cheers

Gaurav