LinuxQuestions.org
Help answer threads with 0 replies.
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 02-08-2017, 01:01 AM   #1
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, USA
Distribution: Centos 7 , Linux Mint 18.1 Under VMware in Windows 10
Posts: 554

Rep: Reputation: 34
CP Command Help


Greetings,

I could use some help in setting up a cp command to copy all .PM files in all the libraries on the system. Get them into one library/directory.

I have tried the following but it doesn't work. The below commands came from a set up to install a tar.gz file for Clamtk and I need to get all the *.PM files

mkdir -p /usr/share/perl5/ClamTk
cp lib/*.pm /usr/share/perl5/ClamTk

Any help will be appreciated. Thanks

Last edited by swamprat; 02-08-2017 at 01:03 AM.
 
Old 02-08-2017, 01:18 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,000
Blog Entries: 3

Rep: Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631
Code:
cp lib/*.pm /usr/share/perl5/ClamTk/
Be sure you are copying to a directory rather overwriting a single file repeatedly.
 
Old 02-08-2017, 01:21 AM   #3
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 529

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
I found several good answers here:
http://superuser.com/questions/31234...o-a-single-dir
The second reply looks interesting. In your case, it would go like this:
Code:
shopt -s globstar
cp lib/**/*.pm /usr/share/perl5/ClamTk
That assumes you are using bash.
 
Old 02-08-2017, 01:25 AM   #4
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 529

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Also I see that you are using .PM in your description and .pm in the command line. The command is case sensitive.
 
  


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
[SOLVED] [SOLVED] bash script: can echo command, command works if I type, but command doesn't work in script ... why? hopeless_n00b Linux - Newbie 10 07-12-2018 05:57 AM
cygwin simple tar command fails when issues on command line deannad Linux - General 1 06-12-2013 10:22 AM
Command/Script required to send an email alert in case command will not respond rajaniyer123 Linux - General 1 05-19-2012 01:12 PM
Executing shell command from JSP file with command line arg from URL orcusomega Programming 2 01-13-2012 03:38 PM
Bash Command Line Editor, while typing run another command before executing current? gumaheru Linux - General 5 04-13-2010 11:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:47 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
Open Source Consulting | Domain Registration