LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-05-2006, 08:43 AM   #1
lotlikar
LQ Newbie
 
Registered: Jun 2006
Location: Goa
Posts: 1

Rep: Reputation: 0
chmod options


Hi
I wanted to know to how to use chmod options
to change my file permissions and permissions
of others.
 
Old 06-05-2006, 08:52 AM   #2
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 528

Rep: Reputation: 78
Hi there

Here is a link with a tutorial on chmod: http://catcode.com/teachmod/

Tips: before posting this kind of how to questions about common commands, here is what you can try first:

1. In a terminal window type man my_command this will give you the manual of this command
2. In google search for how to my_command
3. search in linuxquestions.org if there is no similar post

PS: Please do not take these comment badly, these are just to help you to find the answer you are looking for quickly.

Last edited by angel115; 06-05-2006 at 09:55 AM.
 
Old 06-05-2006, 08:56 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by lotlikar
Hi
I wanted to know to how to use chmod options
to change my file permissions and permissions
of others.
First, you must be the owner of the file to change the permissions. "ls -l" gives you the current permissions, owner, group, etc.

permissions are in three segments for owner, group, and others. Example:
rwxr--r-- means that the owner has full privileges and everyone else has only read
To change so that everyone has execute privileges:
chmod -755 <filename>
The number is the octal code for the rwx sequence (r=4, w=2, x=1)

chmod also has a set of letter codes for doing the same thing

See:
man chmod
man chown
man chgrp
 
Old 06-05-2006, 09:37 AM   #4
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL
Distribution: Funtoo
Posts: 6,926

Rep: Reputation: 128Reputation: 128
Welcome to LQ!

http://www.linuxquestions.org/linux/...le_Permissions

Last edited by Bruce Hill; 06-05-2006 at 10:23 AM.
 
Old 06-05-2006, 10:18 AM   #5
jojojo
Member
 
Registered: Feb 2005
Location: Kuala Lumpur, Malaysia
Distribution: Fedora Core 5
Posts: 121

Rep: Reputation: 15
First log in as root then you can type the permission on any file types using these command:

Code:
chmod 757 abc
Permission are ste with a three number code. The first number (7) is set for the owner, second (5) is for users in owners group and third (7) is for everyone else. The abc is the name of your file.

Permission = Numbers
r = 4
w = 2
x = 1
rx = 5 (4 + 1)
rw = 6 (4 + 2)
wx = 3 (2 + 1)
rwx = 7 (4 + 2 + 1)

So if u want a person to have full access of a file, type chmod 777 abc

Last edited by jojojo; 06-05-2006 at 10:19 AM.
 
Old 06-05-2006, 08:51 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
[QUOTE]
Quote:
Originally Posted by jojojo
First log in as root
Not necessary---the owners can change permissions for all of their files. (Root can change for any file)
 
Old 06-05-2006, 09:46 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Actually, you can use symbolic ie alpha chars, which is easier to remember:

[user1@box1 ~]$ ll t.t
-rw-rw-r-- 1 user1 group1 1099 May 31 17:29 t.t
[user1@box1 ~]$ chmod u=rwx t.t
[user1@box1 ~]$ ll t.t
-rwxrw-r-- 1 user1 group1 1099 May 31 17:29 t.t
[user1@box1 ~]$ chmod u-rwx t.t
[user1@box1 ~]$ ll t.t
----rw-r-- 1 user1 group1 1099 May 31 17:29 t.t
[user1@box1 ~]$ chmod u+rwx t.t
[user1@box1 ~]$ ll t.t
-rwxrw-r-- 1 user1 group1 1099 May 31 17:29 t.t
[user1@box1 ~]$ chmod a+rwx t.t
[user1@box1 ~]$ ll t.t
-rwxrwxrwx 1 user1 group1 1099 May 31 17:29 t.t

The (basic) permissions are : rwx
The 'users' are ugoa ie u=user (owner), g=group, o=other (world), a=all
See man chmod
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
chmod +s binary_0011 Linux - Newbie 2 04-18-2006 05:55 AM
chmod, external usb, vfat - can't chmod a directory itsjustme Slackware 2 04-02-2006 05:23 PM
What can we do if we type chmod ugo-x /bin/chmod ?????? bunny123 Linux - Software 3 02-01-2005 09:53 PM
CHMOD in shell : chmod 777 /usr/ <---is that right? cpanelskindepot Programming 5 07-16-2004 06:37 AM
Kernel 2.6.2 options question - LOCKED options ? tvojvodi Linux - General 0 02-17-2004 05:23 AM


All times are GMT -5. The time now is 02:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration