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)
-   -   unix question (https://gfy.com/showthread.php?t=478195)

Zester 06-08-2005 05:29 AM

unix question
 
lets say I have a folder by the name of "myfolder"
which subfolders: "folder1" "folder2" and "folder3"

how do use the "cp" command to copy everything in folder "myfolder" including subfolders excluding "folder2"?

fireorange 06-08-2005 06:03 AM

Geeks where are you?

fireorange 06-08-2005 06:04 AM

http://www.us-webmasters.com/FreeBSD...-unix-FreeBSD/

I think you need to add -r for recursive.

Hope that helps.

fireorange 06-08-2005 06:05 AM

Quote:

Originally Posted by Zester
how do use the "cp" command to copy everything in folder "myfolder" including subfolders excluding "folder2"?

Oh wait I don't think you can exclude just one sub-dir,

Anyway here's another bump for you :thumbsup

etech 06-08-2005 06:17 AM

I dont think you can exclude a sub folder either.
cp -rf folder
would force to copy the folder recursive

beta-tester 06-08-2005 06:22 AM

for example:

ln -s myfolder/* .

psili 06-08-2005 06:26 AM

I know you can tar the directories and by use of a text file with the folders you don't want listed in there, the tar will exclude anything you don't want. Then just move the tarball to where you want and untar.

I don't remember how exactly to do it, but I've used it on copying huge photoset directories with tons of folders and files I didn't want and tons that I did.

blazin 06-08-2005 06:56 AM

cp -rp

- the p will preserve the file attributes


All times are GMT -7. The time now is 07:32 AM.

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