Q. How do I use chmod and chown command under Linux?
A. Use chown command to change file owner and group information. Use chmod command to change file access permissions such as read, write etc.
chown command
chown command changes the user and/or group ownership of each given file.
For example following command will setup user and group ownership to root user only for /backup directory:
# chown root:root /backup
Set user user ownership to root user and allow any member of ftp group to access file.txt (provided that they have sufficient read/write rights).
# chown root:ftp /home/data/file.txt
The information about chmod command is covered in detailed here.
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- My 10 UNIX Command Line Mistakes
- Linux: 20 Iptables Examples For New SysAdmins

- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Facebook it - Tweet it - Print it -

{ 7 comments… read them below or add one }
Excellent site!! Your explanations are great. Clear and concise and very helpful! Thanks!
it so good but the result it not enough so i want you add more information.
thank you
don’t know where you got this but all you get is an error that the directory does not exist. so if this script is working for you, then your server is set up wrong and you are riding or borrowed time.
doesn’t work
nice lesson =)
its a good one for the ones who use linux for the first time…..can read and learn
Good lesson as far as it goes. However:
This command will only work if the file targeted by the command exists. You can’t change ownership of a non-existent file!