-r paramater with chown and rmdir


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers -r paramater with chown and rmdir
# 1  
Old 02-25-2007
-r paramater with chown and rmdir

If I am root user, and trying to chown everything in a directory and it's subdirectories (e.g. httpdocs and everything inside that directory, including it's sub directories), how would I do that? I tried it with -r but it didnt seem to work...can someone help with the correct syntax?

Also, if I was trying to delete a directory and all it's sub directories, how would i do that? (coulndt get it to work with the -r)

Any help is appreciated.. Thanks
# 2  
Old 02-25-2007
To chown a directory called httpdocs and all files and subdirectories within httpdocs do (substitute for user):
Code:
chown -R user httpdocs

To remove a directory and all files and subdirectories underneath (be very, very careful and make sure you want to do this):

Code:
rm -rf directory

# 3  
Old 02-25-2007
thanks for the reply.

the remove dir with -r worked, but the chown with the -r did not... its says invalid option.

i am on suse linux 10 enterpise, could there be a different command? thanks
# 4  
Old 02-25-2007
dangral, ahh! it works - you must make sure the -R is a capital R...using the lowercase r did not work, but the capital did.

thanks for your help!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Pls help. can't do chown ????

I am trying to change the directory to owner of Sybase. But I get permission denied. I did login as root. newd1> ls -l total 58 drwxr-xr-x 2 prod develop 5 Oct 17 06:51 bin drwxr-xr-x 2 prod develop 7 Oct 17 07:18 etc dr-xr-xr-x 1 root root 1... (15 Replies)
Discussion started by: samnyc
15 Replies

2. Solaris

chown

Hello My oracledatabase creats some xmlfiles. this files has the owner hugo. now I've a script (how runs als hugo2) and this script will insert this XMLFile into the database. But that doesn't work, because the owner of the files is wrong, and hugo has not the rights to insert this files into... (3 Replies)
Discussion started by: Street
3 Replies

3. UNIX for Dummies Questions & Answers

Running script on SFTP server, RMDIR and RM with wildcards

Im going insane trying to figure out what i consider a basic command on an SFTP server... Im trying to download all files from a directory *done* then remove all the files (and sometimes folders that contain files) i have downloaded on the remote directory... the command i would normally... (2 Replies)
Discussion started by: mokachoka
2 Replies

4. Shell Programming and Scripting

Paramater list too long while chmod

Hi i am transferring the files(around 10000) from the Windows sever to the UNIX server in that i run a command chmod 777 filename.txt but it is taking a longer time as it gives chmod for each and every file. So i thouught of giving the permission from the UNIX itself and i tried running chmod... (2 Replies)
Discussion started by: Codesearcher
2 Replies

5. Shell Programming and Scripting

cp, chown, untar

hello i want shell script. i have a source.txt /home/user409/public_html/test/ /home/user09876/public_html/xdsss/ /home/user9765/public_html/320xxx/ . . . maybe 1000 lines i want . 1.read a source.txt 2.untar special.tar.gz into these directory in source.txt 3.i want to... (14 Replies)
Discussion started by: topic32428285
14 Replies

6. UNIX for Dummies Questions & Answers

chown

is there a difference in chown on a file or a directory? how do i chown a directory and all the contents? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

7. UNIX for Dummies Questions & Answers

Quick question...rmdir -l

Hello, We use a very basic version of unix via putty and are not experts by any means. We accidentally submitted the statement: "mkdir -l" ("dash-letter L) and a new directory was created. Putty/UNIX will now not recognize the statement "rmdir -l". When we run a "ls -l" command, it shows... (3 Replies)
Discussion started by: UDcc123
3 Replies

8. AIX

chown

hello chown not change ownership before: 205:system ~kuku chown kuku:system ~kuku after no change 205:system ~kuku aix box can someone help me? ariec (2 Replies)
Discussion started by: ariec
2 Replies

9. Shell Programming and Scripting

Cp All But Some Files, paramater for cp command?

I'm creating a shell script, part of which has a cp command.So far i've got: cp --recursive --reply=yes /development/myProgram/* /somewhere/else I need to add something that says to not copy certain files, in this case all directories named "CVS" and files named ".project" and... (2 Replies)
Discussion started by: allelopath
2 Replies

10. UNIX for Dummies Questions & Answers

rmdir a non-empty directory.

hi, i understand that rmdir will only remove direcotry when it is empty but are there options which will also remove non-empty directories? i went to man rmdir but only find the option -p? i am on solaris. thanks (2 Replies)
Discussion started by: yls177
2 Replies
Login or Register to Ask a Question