LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-06-2007, 04:58 AM   #1
ajaz_javeed
LQ Newbie
 
Registered: Jan 2007
Posts: 24

Rep: Reputation: 15
How to use the CP command


Hello everybody,

I have a bunch of files named bkp1.arch to bkp99.arch.

I want to copy just files named bkp11.arch to bkp92.arch.

What is the exact CP command in this situation ?

Thanks and Regards
AJAZ
 
Old 03-06-2007, 08:07 AM   #2
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Type in a console man cp or cp --help to see what options are available.
 
Old 03-06-2007, 08:32 AM   #3
anindyanuri
Member
 
Registered: Jan 2005
Location: India
Distribution: Kubuntu Gutsy
Posts: 450

Rep: Reputation: 30
Code:
cp -R bkp??.arch /path/to/copy/the/files/
It will also copy the bkp10.arch file too. You may delete it if not required.


I am stuck here..... Anybody with more idea?
 
Old 03-06-2007, 09:24 AM   #4
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
@anindyanuri: close, but your command may also include the 93...99 files (besides the file with number 10 that you mentionned).

Code:
cp -R bkp1[1-9].arch bkp[2-8]?.arch bkp9[0-2].arch /path/to/copy/the/files/
should do the trick...
 
Old 03-07-2007, 11:44 AM   #5
mtb
Member
 
Registered: Nov 2002
Location: Italy
Distribution: Linux Mint 17 Xfce
Posts: 292

Rep: Reputation: 30
Many ways to do so, another one:

for i in `seq 11 92` ; do cp bkp$i.ark <destination-dir> ; done
 
Old 03-07-2007, 11:57 AM   #6
swiftnet
Member
 
Registered: Aug 2003
Location: Florida, USA
Distribution: Mandrake, Knoppix, Yoper
Posts: 97

Rep: Reputation: 19
Are you overwriting bkp92.arch?

"I want to copy just files named bkp11.arch to bkp92.arch"

To me it sounds like you want to overwrite bkp92.arch with bkp11.arch, if that is the case then:

cp -f bkp11.arch bkp92.arch
 
  


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
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 07:19 PM
Require Linux/Perl equivalent command for windows Command alix123 Programming 7 08-19-2005 02:23 AM
Why after start of a command the invitation for input next command has not appeared. ukrainet Linux - General 3 06-24-2005 08:16 AM
Key stroke/command to shut down x and go into the command prompt screen? Fear58 Linux - General 1 07-14-2004 07:14 PM
Command to display whole filestructure hierarchy f/ command line? mjewell Linux - Newbie 10 01-19-2004 10:48 AM

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

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