LinuxQuestions.org
Review your favorite Linux distribution.
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 09-01-2010, 01:19 PM   #16
greenpoise
Member
 
Registered: Feb 2010
Posts: 37

Original Poster
Rep: Reputation: 2

Quote:
Originally Posted by crts View Post
Then try this
Code:
find /your/music/dir -type f -name album.jpg -exec sh -c 'cp "$1" $(dirname "$1")/covers.jpg' {} {} \;
No, it did not do the job. Hmmm I myself have no idea
 
Old 09-01-2010, 01:26 PM   #17
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,608

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Quote:
Originally Posted by greenpoise View Post
No, it did not do the job. Hmmm I myself have no idea
Did you replace '/your/music/dir' with your actual music directory? In your case that would be something like '/home/dan/Music'.
Was there any output? Error messages?
 
Old 09-01-2010, 01:33 PM   #18
greenpoise
Member
 
Registered: Feb 2010
Posts: 37

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by crts View Post
Did you replace '/your/music/dir' with your actual music directory? In your case that would be something like '/home/dan/Music'.
Was there any output? Error messages?
I did.
 
Old 09-01-2010, 01:39 PM   #19
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,608

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Maybe it is a whitespace issue:
Code:
find /your/path -type f -name album.jpg -exec sh -c 'cp "$1" "$(dirname "${1}")/covers.jpg"' {} {} \;

Last edited by crts; 09-01-2010 at 01:42 PM.
 
Old 09-01-2010, 01:44 PM   #20
greenpoise
Member
 
Registered: Feb 2010
Posts: 37

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by crts View Post
Maybe it is a whitespace issue:
Code:
find /your/path -type f -name album.jpg -exec sh -c 'cp "$1" "$(dirname "${1}")/covers.jpg"' {} {} \;
Impressive..I wish I could come up with stuff like this. Not even with man find...Thanks alot..
 
Old 09-01-2010, 01:45 PM   #21
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,608

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
You are welcome.
 
  


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
find files with pattern, then copy those files to another directory ncsuapex Programming 4 08-13-2010 03:38 PM
How to Copy files from local directory to a particular directory using alias dynamics Linux - Newbie 7 09-11-2009 04:19 PM
How to copy files after search in array from this directory to another directory! phanvinhgiap Programming 4 01-04-2009 06:48 PM
How to copy one directory to another directory thru PHP? green_njk Programming 1 01-06-2006 06:55 AM
copy files from directory to directory without subfile ALInux Linux - General 2 06-03-2005 11:51 AM


All times are GMT -5. The time now is 05:08 AM.

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