Hello Wanna know how to give  permission to change files in linux?
Cause I wanna copy some executables to a folder but it says I cannot cause I dont have the permissions.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Permissions have to be given by a user that can change permissions on files or folder, or who can change group memberships.

Te commands to change permissions on files or folders are chmod and chown.

Chown changes the ownership of a file. The command `chown user1 example` changes the owner of the file 'example' to user1, and the group to user1's default group. The command `chown user1:wheel example` does the same to the ownership, but the group is set to wheel.

Chmod changes the permission bits of a file. Every file has 3 permission switches for 3 groups: u (user owner), g (group owner) and o (others), can independently allowed r (read access), w (write access) and/or x (execute access). The command chmod requires the parameters either in a form that specifies the user and the permissions or permission changes (like u+x, o-rwx) or as an octal number that is a bitfiels of the permission bits with the values r=4, w=2 and x=1 (ie. rwx = 4+2+1 => 7, chmod needs one digit for each group, eg. 644). The command `chmod u+rw example` would allow the user owner (the one you set with the chown command) read and write access. The command `chmod go-x example` would disallow execution of the file example by any group members of the owning group, as well as anyone else. The execute permission of the user owner is untouched. The command `chmod 755 example`would give the user owner read, write and execute permissions, the group owner and everyone else only read and execute.

Depending on your filesystem, your linux might offer other ways of setting permissions. There might be tools that set ACLs. Common unix tools are the ones I described. Please also consult the man pages (type `man chmod` and `man chown`).

You need to change permissions on the target folder.  You need to have write and execute permissions on the target folder (where you would like the files to be copied).

first see who owns it.

ls -ld /path/to/folder

Then you can change ownership by
chown user:group folder

Change the permissions
chmod 777 target_folder
GiorgioCarlosAuthor Commented:
ok thanks , I wanna change a system file permissions

chmod 777 usr/share/java :   it appears me that the file does not exist
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.


chmod 777 /usr/share/java
GiorgioCarlosAuthor Commented:
You are most welcome

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.