Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 
 

Change Oracle file Ownership

Linux Tips by Burleson Consulting

The chown (change owner) command can be used to change ownership of a file or directory.  The syntax is very similar to chgrp.

# ls -l

total 12

-rw-rw-r--    1 tclark   authors      2229 Jan 13 21:35 declaration.txt
-rw-rw-r--    1 tclark   authors      1310 Jan 13 17:48 gettysburg.txt
-rw-rw-r--    1 tclark   authors       360 Jan 13 17:48 preamble.txt

# chown abe gettysburg.txt         

# ls -l

total 12

-rw-rw-r--    1 tclark   authors      2229 Jan 13 21:35 declaration.txt
-rw-rw-r--    1 abe      authors      1310 Jan 13 17:48 gettysburg.txt
-rw-rw-r--    1 tclark   authors       360 Jan 13 17:48 preamble.txt

Just like with chgrp we see that chown accepts the username of the user who should get ownership and the file or directory to change.  Again we could list multiple files or directories here with spaces separating them.

The chown command can be used to change the group ownership instead of the user ownership of a file or directory.  If you wish to use chown to change the group ownership you can list a group preceded with either a colon (:) or a period (.).  Here's an example of how to use chown to change the group ownership of a file:

# ls -l
total 12
-rw-rw-r--    1 tclark   authors      2229 Jan 13 21:35 declaration.txt
-rw-rw-r--    1 abe      authors      1310 Jan 13 17:48 gettysburg.txt
-rw-rw-r--    1 tclark   authors       360 Jan 13 17:48 preamble.txt
# chown :presidents gettys*
# ls -l
total 12
-rw-rw-r--    1 tclark   authors      2229 Jan 13 21:35 declaration.txt
-rw-rw-r--    1 abe      presidents     1310 Jan 13 17:48 gettysburg.txt
-rw-rw-r--    1 tclark   authors       360 Jan 13 17:48 preamble.txt

If you wish to simultaneously change both the user and group ownership of a file you can specify the user and group in the format of user:group.

In the following example the user will be changed back to tclark and the group back to authors using a single command.

Using the chown Command to Change File Ownership

# ls -l
total 12
-rw-rw-r--    1 tclark   authors      2229 Jan 13 21:35 declaration.txt
-rw-rw-r--    1 abe      presidents     1310 Jan 13 17:48 gettysburg.txt
-rw-rw-r--    1 tclark   authors       360 Jan 13 17:48 preamble.txt
# chown tclark:authors gettys*
# ls -l
total 12
-rw-rw-r--    1 tclark   authors      2229 Jan 13 21:35 declaration.txt
-rw-rw-r--    1 tclark   authors      1310 Jan 13 17:48 gettysburg.txt
-rw-rw-r--    1 tclark   authors       360 Jan 13 17:48 preamble.txt

Here we see the user and group has been changed with a single command.  Just like with chgrp the chown command will take the ?R (recursive) option and apply the chown command to a directory and its subdirectories.  This should be used with care.


This is an excerpt from "Easy Linux Commands" by Linux guru Jon Emmons.  You can purchase it for only $19.95 (30%-off) at this link.


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational