LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-31-2008, 01:15 AM   #1
madhi
Member
 
Registered: May 2008
Posts: 31

Rep: Reputation: 15
Need one liner copy command


Hi all,

I have 100 files in a source directory; need to copy all files except 4 or 5 files (which has different file extensions) to the target directory.

Can anyone give a one liner command to do this task

Thanks in advance
-Madhi
 
Old 07-31-2008, 01:22 AM   #2
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 40
This might be a little clumsy but it works:
Code:
cp `ls * | grep -v file1 | grep -v file2 | grep -v file3` newfolder
 
Old 07-31-2008, 01:32 AM   #3
madhi
Member
 
Registered: May 2008
Posts: 31

Original Poster
Rep: Reputation: 15
Thanks Arungoodboy, it works.
 
  


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
LXer: Simple Shell One-Liner To Enumerate File Types In Linux and Unix LXer Syndicated Linux News 2 05-30-2008 08:47 AM
How to turn a file to a one liner thru sh script? jillann Linux - Newbie 15 04-18-2007 09:32 AM
Share your greatest one-liner!! PenguinPwrdBox General 3 08-20-2005 10:45 PM
one-liner to see current internet bandwidth usage doorbits Debian 6 11-01-2003 02:10 PM
one liner needed for search and replace chr15t0 Linux - General 2 09-24-2002 10:00 AM

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

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