|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Operating Systems > Linux, Unix | |
UNIX Nub Question
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | |||||||||||||
|
Apple Doesn't Love You
|
How to I pipe into a command with multiple arguments? I want to pipe the output of find /media/shared/music into chown <username> <output of find>
|
|||||||||||||
|
|
|
|
#2 (permalink) | |||||||||||||
|
Multi-Quote King
|
UNIX/Linux irritates me... I'm on Fedora right now lol
__________________If i was to guess, i'd say you have to use quotes to group whatever needs to be grouped? I don't know. ![]()
|
|||||||||||||
|
|
|
|
#3 (permalink) | |||||||||||||
|
Security Sleuth
|
Yes, there is a way.
__________________chown -R user /media/shared/music This will change the folder and all of its contents ownership to the user that you specify. Here is the syntax chown [ -f ] [ -h ] [ -R ] Owner [ :Group ] { File ... | Directory -R means reclusive, aka continue to change until nothing left to change lol(within that directory) so if there are additional folders within the /music directory, it will change the ownership of those folders and their contents as well.
Last edited by kc-tr : 06-03-07 at 08:31 AM. |
|||||||||||||
|
|
|
|
#4 (permalink) | |||||||||||||
|
Apple Doesn't Love You
|
Nice - I didn't know there was a recursive flag.
Do you know how to do the pipe that way in general?
|
|||||||||||||
|
|
|
|
#5 (permalink) | |||||||||||||
|
Security Sleuth
|
I dont know that you can use it with the find command, however I have never tried. Also what exactly do you mean by pipe it out?
__________________
|
|||||||||||||
|
|
|
|
#6 (permalink) | |||||||||||||
|
Apple Doesn't Love You
|
Take the output of 'find /media/shared/music' and have it as the second argument of chown
|
|||||||||||||
|
|
|
|
#7 (permalink) | |||||||||||||
|
Security Sleuth
|
so basicly.. Change ownership of all the files/subdirectories of that folder. Then find the contents? if so you could do..(if my syntax is right lol)
__________________chown -R user /media/shared/music | find /media/shared/music -user user the last "user" listed would be your username after the -R. Try that and see if it works. Edit: a little more info on the command listed above. the | allows you to run two commands, run the first one then the second one. to make that line press shift \
Last edited by kc-tr : 06-03-07 at 08:52 AM. |
|||||||||||||
|
|
|
|
#8 (permalink) | |||||||||||||
|
Apple Doesn't Love You
|
That would pipe the output of chown into find
Forget chown and find for a second. What I want to do is take the output of any unix function and put it in as an argument for the second
|
|||||||||||||
|
|
|
|
#9 (permalink) | |||||||||||||
|
Security Sleuth
|
ahh ok, well its not designed that way however you can do it manually, by making a text document for example with commonly used commands save the ones you want and create a shell script out of it, however even that would require it being edited every time you used it.
__________________the os itself is not designed that way because there are many instances where that will cause a problem or a syntax error.
|
|||||||||||||
|
|
|
|
#10 (permalink) | |||||||||||||
|
Apple Doesn't Love You
|
I'm positive that there is a way to do this in unix.
I could easily make a script to do it with any command/arg number but I would rather use the system as it is now
|
|||||||||||||
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|