Need Help Understanding a Unix Command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Need Help Understanding a Unix Command
# 1  
Old 10-09-2006
Need Help Understanding a Unix Command

Trying to install something. Can someone explain what this means?

chmod -R a+r .
chmod -R a+w logo.gif tempdir/ templates_c/

I recognize that file permissions are being changed (chmod), but beyond that, it's Greek to me.
# 2  
Old 10-09-2006
Technically it's all "geek" to you Smilie

Anyway, you should be able to man chmod to see what's going on. Quickly though.

-R - recursive, all files/directories under the directory identified will be modified
a - All three octets (user, group, and world perms) will be modified
+r - Add read access
. - file/directory to be modified

So the first command says to add read access to all users for all files in the current directory and all subdirectories

The second command is already mostly explained.

+w - Add write access
logo.gif tempdir/ templates_c/ - files/directories to be modified

The reason you'd use this format is that you don't want to modify any subdirectories or files other than the read and/or write access bits.

Carl
# 3  
Old 10-09-2006
Yep, it's all geek to me. Smilie Thanks for the explanation. Just to clarify, I can't use man chmod (guessing that "man" means manual/documentation on chmod commands?) b/c I don't have shell access through my web host, and I've never used Unix before.

I'm using an FTP program (Filezilla) to chmod permissions.

So, for the first command, that would be chmod 777.
And the second command would be chmod 777 for 3 files/folders: "logo.gif" "tempdir", and "templates_c."

Yes? Did I get that right?
# 4  
Old 10-09-2006
Nope sorry. Bits being turned on are the read bits. If you look at a file (or directory) in unix, you see way on the left the permissions. You'll have 10 positions. The first one generally identifies a file as "directory" and you'll have a 'd' in that position (there are others but most of the time you won't have to deal with them). In the next three positions are the user bits and show what permissions the owner of the file has. Next three are the group bits which shows group permissions and the last three are the world bits which shows what everyone has access to.

Each octet is a simple binary number but is depicted with rwx. Read, Write and Execute. If you know binary, the end position when it's on is '1', the center one is '2' and the left one is '4'. So 777 is the same rwxrwxrwx. 755 is rwxr-xr-x, a more common permissions setting for a script and 644 (rw-r--r--) is more common for a data or text file.

Your first command is something like doing a chmod 444 . and then a chmod 222 logo.gif etc... Unfortunately if you have a file in a subdirectory that has 755 for a specific reason, running those chmod commands will that script (and it's probably a script) from running since the execute bit is now off. That's why you use the a+r and/or a+w switches vs 444 or 222. The scripts and data that have a specific permission for a reason will at least maintain that permission and if it doesn't already have read or write, it's modified to add that permission.

Make sense? I can try to be clearer. You can also go to google and do a search on "man chmod". Lots and lots of man pages on the 'net Smilie

Carl
# 5  
Old 10-09-2006
Carl, thanks for trying to explain. Unfortunately, I'm still a bit confused as to what I need to **DO** in Filezilla. If I had shell access via my webhost, I could simply follow the instructions in the PDF. Unfortunately, that's not the case.

When I right-click on a folder/file, and choose Permissions, I have these options in Filezilla (FTP app).

Owner Permissions
Read, Write, Execute

Group Permissions
Read, Write, Execute

Public Permissions
Read, Write, Execute

The RWX options (underneath each heading) are checkboxes that I'm supposed to check off. Underneath the checkboxes, there is a box for using the numeric code (777, 755, etc), instead of having to check off boxes individually.

For the 2 Unix commands above, what do I need to check off?

Note: When I check RWX for all categories (owner, group, public), the numer changes to 777. If the owner permissions are RW, and the public and group permissions are read only, then the number changes to 644. I just need a comparable translation for Filezilla, since I can't use command-line Unix.
# 6  
Old 10-10-2006
You should really read this tutorial on UNIX file permissions. It should help you understand the numeric vs. "rwx" notation.
# 7  
Old 10-10-2006
I figured it out. It was simpler than I thought. As usual, I was making it way too complicated.

Thanks again Carl. Nathan, thanks for the link.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

understanding sed command

Hi Friends, I need a small help in understanding the below sed command. $ cat t4.txt 1 root 1 58 0 888K 368K sleep 4:06 0.00% init 1 root 1 58 0 888K 368K sleep 4:06 0.00% init last $ sed 's/*$//' t4.txt 1 root 1 58 0 888K ... (3 Replies)
Discussion started by: forroughuse
3 Replies

2. UNIX for Dummies Questions & Answers

Understanding nm command output

After running nm command on any object file from out put can we get to know that wheather a symbol is a call to a function or definition of function ? I am searching a class and function definitions inside many .so files. I have 3 files which contain the symbol but I don't know wheather they... (2 Replies)
Discussion started by: yatrik007
2 Replies

3. Shell Programming and Scripting

Understanding 'find' command

I want to understand what does this command do:confused::confused: find . \( -type f -o -type 1 \) Plz someone explain me ! Thanks much in advance!! (2 Replies)
Discussion started by: sears
2 Replies

4. Shell Programming and Scripting

perl command understanding

Hi All, Can you please help me interpret the following command. Which I am not able to understand. Also can you please illustrate what it is used for. perl -pi -e 's/\015//g' text_file.dat Regards (3 Replies)
Discussion started by: rakesh.su30
3 Replies

5. Solaris

Understanding 'du' command

Hi I have a questions related 2 commands : 'du' and 'ls'. Why is the difference between output of 'du' and 'ls' cmd's ? Command 'du' : ------------------ jakubn@server1 /home/jakubn $ du -s * 4 engine.ksh 1331 scripts 'du -s *' ---> shows block count size on disk (512 Bytes... (5 Replies)
Discussion started by: presul
5 Replies

6. UNIX for Dummies Questions & Answers

Understanding the output command

Could you please explain me whats happening in the below code, appreciate your help, Thank you. /product/apps/informatica/v7/pc/ExtProc/NewDAC/dacRecBuilder.sh /product/apps/informatica/v7/pc/TgtFiles/NEW_DAC/DAC_Pos_TradeInv_Records.out ... (5 Replies)
Discussion started by: Ariean
5 Replies

7. Shell Programming and Scripting

understanding mv command

hi i was moving a file from one directory to another with the following cmmand mv /home/hsghh/dfd/parent/file.txt . while doing so i i accidently mv /home/hsghh/dfd/dfd . although i gave ctrl c and terminate the move command some of the file are missing in the parent directory and... (1 Reply)
Discussion started by: saravanan71184
1 Replies

8. Shell Programming and Scripting

understanding the kill command

Hi Guys, I like to know if i have a process which triggers 10 different child processes. How to identify out of the 11 processes running which is the parent process and what are the child process? And if i kill the parent process will the child process be killed.. if not is there a way to... (2 Replies)
Discussion started by: mac4rfree
2 Replies

9. Shell Programming and Scripting

Help Needed in understanding this command

Hi All, I search the forum for my query, Glad that got solution to it. But i really want to understand how does this command work. sed -e ':a' -e 's/\("*\),\(*"\)/\1~\2/;ta' Basically it is replacing all the comma(,) characters in between quotes with a tilde. Specially what does ':a' ,... (2 Replies)
Discussion started by: DSDexter
2 Replies

10. UNIX for Dummies Questions & Answers

Understanding UNIX/Linux

Hello: I'm a totally newbie here. My company has UNIX. My development team would like me to learn UNIX and shell scripting. I've worked with Linux in the past, very briefly. I have Ubuntu installed on my laptop. I was wondering whether or not the shell scripting for Linux is the same... (0 Replies)
Discussion started by: hbradshaw
0 Replies
Login or Register to Ask a Question