What is the need of ownership to a file/dir?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers What is the need of ownership to a file/dir?
# 1  
Old 03-04-2010
MySQL What is the need of ownership to a file/dir?

Hi,

I understand the permissions of a file/directory.
I just needs to understand how ownership works. Can some one help me on this please?

Thanks in advance.
# 2  
Old 03-04-2010
ownership is intimately linked to permission...
permissions (you understand...) are given to 3 categories (have not found better explanation for now...):
owner
group
other
all files/directories are owned by someone, belong to a group, and have set permission for others
This allows to fine tune who has access and how to the given directory/file

For instance your history file is personal => perms are rwx------, you are the owner and the group you see you belong to is most certainly your default: GID

Last edited by vbe; 03-04-2010 at 01:08 PM.. Reason: typo...
# 3  
Old 03-04-2010
Quote:
Originally Posted by vbe
ownership is intimately linked to permission...
permissions (you understand...) are given to 3 categories (have not found better explanation for now...):
owner
group
other
all files/directories are owned by someone, belong to a group, and have set permission for others
This allows to fine tune who has access and how to the given directory/file

For instance your history file is personal => perms are rwx------, you are the owner and the group you see you belong to is most certainly your default: GID
And only the owner of a file may use chmod/chown to alter a file's permissions/ownership and use chgrp to change it to a group of which he is a mermber.
# 4  
Old 03-04-2010
You can read from this link too...
Learning the shell - Lesson 7: Permissions
# 5  
Old 03-05-2010
Another question about ownership and permissions

Hello Unix community. I have a follow-up question about ownership and permissions. I am new to Unix too. In fact, I am not a programmer but an auditor. So you might say I really don't know anything! I was given the following as an answer to one of my questions. Can someone translate this in plain english for me please?

NewBREW#l /etc/su*
-r-x------ 1 root root 3560 Jan 11 2003 /etc/suds_ctrl@
NewBREW#
# 6  
Old 03-05-2010
Quote:
Originally Posted by cfkap
Hello Unix community. I have a follow-up question about ownership and permissions. I am new to Unix too. In fact, I am not a programmer but an auditor. So you might say I really don't know anything! I was given the following as an answer to one of my questions. Can someone translate this in plain english for me please?

NewBREW#l /etc/su*
-r-x------ 1 root root 3560 Jan 11 2003 /etc/suds_ctrl@
NewBREW#
If that was the answer to your question, it might help if you told us what the qestion was!

Read and execute for owner. The @ probably means it's a symbolic link. If that was your question Smilie
# 7  
Old 03-06-2010
you are missing an 's -la' I believe, perhaps you did not copy it all? it should look like
Code:
ls -la /etc/su*
-r-x------ 1 root root 3560 Jan 11 2003 /etc/suds_ctrl@

The ls says to list /etc/su* is a "glob" which means list any files in the /etc directory that beginning with su. In this case, the suds_ctrl file is owned by root and can only be executed (or read) by root. It is possible that the l command was an alias for ls -la.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Create file Dir and Sub Dir same time

Hi Guys , I want create files Dire and Sub Dire. as same time using variable. EX: x1="/hk/Pt/put/NC/R1.txt" x2="/hk/pt/Put/Ot/NC/RN.txt" And i want delete all after done with my script. Thanks (2 Replies)
Discussion started by: pareshkp
2 Replies

2. Shell Programming and Scripting

File Ownership Change

Hi, I have several directories under an upload directory where differnt users upload their files (with exxactly the same file name every week) using their own user ids. There is a requirement that once any user uploads the file I have to clean that file and remove extra whitespaces and... (3 Replies)
Discussion started by: vbhonde11
3 Replies

3. Red Hat

Linux file ownership

Hi Friends, I am using RHEL5.3 64bit. I have a data filesystem on this, which have lot of files copied from another server. I cannot see correct owner and group displayed for these servers. It shows 113 for owner and 755 for group. Anybody please tell me why it is? Regards, Arumon (1 Reply)
Discussion started by: arumon
1 Replies

4. UNIX for Dummies Questions & Answers

How to list all files in dir and sub-dir's recursively along with file size?

I am very new to unix as well as shell scripting. I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies

5. UNIX for Dummies Questions & Answers

Copying dir (and sub dir) file names from ftp server to txt file in diff server

Hey all, i want to copy only the file names from an ftp server (directory and all sub directory) to a text file in another server (non ftp), i.e. i want to recursively move through directories and copy only the names to a text file. any help is appreciated...thank you in advance (1 Reply)
Discussion started by: deking
1 Replies

6. Shell Programming and Scripting

Moving file(s) from dir to dir

Hi, I am fairly new to writing scripts. I am trying to write a script that moves either One or All of the files from one directory to another. I know how to make the actual command to do it, but i don't quite know how to add operators to it, ie -i or -a. I want -i to move one file from... (4 Replies)
Discussion started by: SirJoeh
4 Replies

7. Shell Programming and Scripting

file ownership confusion

Hello all, I have a script that runs on both the test and production box. The script is owned by a user (abcd for example) with permission set to 700. When this script is run as a root, the log file generated has owner and group as abcdowner and abcdgroup respectively. Now, when I run the same... (4 Replies)
Discussion started by: solaix14
4 Replies

8. Shell Programming and Scripting

copying a file from one dir to another dir

hi i have a script compareFiles() { find /tmp/Satya -type f | \ while read filename1 do echo "----------------------------------------$filename1" find /tmp/Satya -type f | \ while read filename2 do if diff $filename1 $filename2 then echo "Both files... (3 Replies)
Discussion started by: Satyak
3 Replies

9. Shell Programming and Scripting

help regarding file ownership

hi friends,i have a doubt,if there is a file for which i have only read access then is there any way to execute it,plz reply soon (5 Replies)
Discussion started by: amit007
5 Replies

10. UNIX for Dummies Questions & Answers

Unix ownership from directories and file

Hi, I have newly installed sun solaris on my pc since I would like to learn something more about unix. During the installation, I had to assign a password for the super user root.After the installation, the book I am following suggested me to create a new user which I did. My home directory is... (1 Reply)
Discussion started by: giulianob
1 Replies
Login or Register to Ask a Question