LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-03-2009, 08:12 PM   #1
penduleum
LQ Newbie
 
Registered: Mar 2009
Posts: 16

Rep: Reputation: 0
using chmod on multiple files.


Evening.


I ame trying to change the premissions of a bunch of music files.
It seems that all my mp3īs, flac aac ect have read/write premissions...


I ame using mediatomb, but it whants only music files whit read premissions... (mediatomb the last section..)

I have tryed to do the following:

Code:
chmod -R 400 *.*
This is from the main music map (/media/music/)

Now, if i do that whit the user that must have the read rights, i get on almost evry map the following error:

cannot access: bla bla; premission denied.


When i do a chmod 707 or even 777, i dont have any errors...

If i do it this way: sudo chmod -R 400 *.* , the normal user, cant use the files... (its also logic, as sudo "takes" the file..)

What i whant, is to have a possebilety to set the premission on about 4k music files to 400, whit read and writ access to the map, anny map on the music partition, so i can expand the collection.

Futher more, if possible, i also whant that all the incomming music files (the extention does not mater) stays whit the read only rights... (this is handy, but not realy nessesary...)

i have locked around the net, and found the -R swithc. But what ever i do, i cant see to solve this litle problem :=)


thx for any help...
 
Old 04-03-2009, 09:37 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
What is "the map"? You should still be able to do this as root (sudo)
and then just also "sudo chown -R your_user /media/music" ...
 
Old 04-04-2009, 06:43 AM   #3
penduleum
LQ Newbie
 
Registered: Mar 2009
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
What is "the map"? You should still be able to do this as root (sudo)
and then just also "sudo chown -R your_user /media/music" ...


the maps are all listed in music. music a disk, full of music.
So, its evrything in there..

i gona try your string, just to se what shud happen..
thx for your input..

Edit:

i have tryed the next command:

sudo chmod 400 -R myuser /media/music/music/ *.*

The *.* is for all the files and subfiles that are in the music dir.

I got the following error:

chmod: cannot access `myuser': No such file or directory

In the end, it changes the premissions to 400, and the user `myuser`cant get access to the dir `music.

If i look at a mp3 in one of the dir, it has the following rights:

-rwx---r-x

I forgot to mention that it is a Ubuntu 8.10 system..

ofcourse, if i go to the subdir, and do a chmod 400 *.*, it changes the files to the correct user, and i have still acces... but to do that in over 400 dirs......

edit:

i think that i have found the right chmod command..

I have done the following:

chmod -R a-x+X /media/music/music/


this sets all the files and subfiles to read only.

Then i have changed the premissions to rxw for mediatomb.db. Maby not smart or nessecary, but it seems that it is reading all the files, whitout problems. I dont have found anny error, regardless the extention (mp3, wav, flac ect).
I can only try it out when it is done reading the files. so, i will keep you updated.

thx for the input.

Last edited by penduleum; 04-04-2009 at 09:12 AM.
 
  


Reply



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 all files 644 and files 755 cope Linux - General 7 01-04-2014 10:52 PM
chmod for files only? jedimastermopar Linux - General 4 03-14-2008 09:38 AM
chmod 775 to only the directories and chmod 664 to only the files? apachenew Linux - Security 6 09-27-2007 03:26 PM
chmod on files only manoj.linux Linux - Enterprise 3 09-10-2007 02:50 AM
using chmod for multiple files matrix13 Linux - General 3 02-14-2007 04:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:46 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
Open Source Consulting | Domain Registration