LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-15-2007, 05:56 PM   #1
trscookie
Member
 
Registered: Apr 2004
Location: oxford
Distribution: gentoo
Posts: 463

Rep: Reputation: 30
tricky bash commands :S


hello all I am trying to find out some different commands that i can use in bash like this one:

Code:
cp `locate -i "kings of" | grep /home/cookie | grep -v wma` $ipod
the only problem is, is there are spaces in the file names so how can i achieve this command i think the find equivelent would be something like this:

Code:
find . -ilname "kings of" -exec cp "{}" $ipod \;
however find is too slow
 
Old 03-15-2007, 07:01 PM   #2
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
Something like this one?:

IFS=$'\n'; for file in $(find /home/cookie -type f | grep -v wma); do echo "copying: $file"; cp "$file" "$ipod"/; done
 
Old 03-16-2007, 04:12 AM   #3
trscookie
Member
 
Registered: Apr 2004
Location: oxford
Distribution: gentoo
Posts: 463

Original Poster
Rep: Reputation: 30
yes please, like that but using locate.
 
  


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
Help with bash commands cmfarley19 Linux - General 6 07-14-2006 08:04 AM
bash commands davatar Slackware 2 04-06-2005 03:05 AM
bash commands Obie Linux - Security 4 08-15-2004 02:42 PM
Help with BASH Commands rridler Linux - Newbie 3 04-16-2004 04:43 PM
Bash commands PhuckFonix Linux - Newbie 2 03-30-2004 07:13 PM

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

All times are GMT -5. The time now is 06:08 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