Tag Info

Hot answers tagged

68

cp --preserve=links From the man page: --preserve[=ATTR_LIST] preserve the specified attributes (default: mode,owner- ship,timestamps), if possible additional attributes: context, links, xattr, all Personally, I use cp -av for most of my heavy copying. That way, I can preserve everything - even recursively - ...


41

Raymond Chen wrote a very nice article about this once. Basically, the dialog is just guessing :). http://blogs.msdn.com/b/oldnewthing/archive/2004/01/06/47937.aspx "Because the copy dialog is just guessing. It can't predict the future, but it is forced to try. And at the very beginning of the copy, when there is very little history to go by, the ...


40

You can use find and cpio to do this cd /top/level/to/copy find . -name '*.txt' | cpio -pdm /path/to/destdir (-updm for overwrite destination content.)


39

From the PuTTY manual: PuTTY's copy and paste works entirely with the mouse. In order to copy text to the clipboard, you just click the left mouse button in the terminal window, and drag to select text. When you let go of the button, the text is automatically copied to the clipboard. You do not need to press Ctrl-C or Ctrl-Ins; in fact, if you do press ...


31

I am going to count to ten, 1....2....3....4 how many dots is it going to take to get to 10? 5.6.7 What about now? Do you take in to account all past dots between numbers and average it, do you only take the last 4 intervals and use that average, do you only look at the last interval? You have the same problem with file transfers. The speed that the file ...


28

It sounds like rsync is definitely what you are after. You do not need to set up an 'rsync server' to copy files from one machine to another. Rsync supports copying files over SFTP (SSH File Transfer) which most linux boxes have enabled already (if not manually disabled). See Lifehacker's Mirror files across systems with rsync for more details: Whether ...


25

I use teracopy for this. Simply a much better than the default copy handler for windows. And it handles file copies sequentially in stead of trying to multitask everything together resulting in NO performance.


24

This isn't really programming related, but you can use scp to do this. scp file.zip remote-box-name:/path/to/destination/file.zip If your username is different on the remote box, you will need to prefix it: scp file.zip yourusername@remotebox:/path/to/destination/file.zip And to retrieve a file you could do this: scp ...


23

This is a pretty decent compromise: http://www.stevemiller.net/puretext/ Edit: I realize I specifically did not answer what you asked, but this may be of use to someone else with a more general version of your question.


22

Two directories a and b. Both have files in. You are in a directory that contains a and b. cp -r ./a b -r = recursively.


22

Try: cp -ra /backup/olduser/. /home/newuser


20

You can quite easily build your own solution for Windows using autorun.inf and a .bat file. Create a bat file to copy a directory to your usb drive. xcopy /e /y c:\podcasts\*.* .\dir_on_usb_drive Place the bat file on your mp3 player and create an autorun.inf using these instructions Now you should have your own homebuilt solution to your problem but ...


20

Unfortunately, no. And I believe this is by design. The issue is that the Windows clipboard does not have to store the data. It is effectively a clearing house where any application can list the data that was just copied (or cut) and offer it up to any application (including itself) to be pasted. The clipboard contains a list of formats in which the data is ...


19

In short: the poor algorithms and the jumpy estimation is actually an implementation weakness. Other tools like TeraCopy do a better job. I think it is not worth explaining why their implementation is not good. They will have noticed it and will improve. What is difficult: You have to take into account resource fluctuations (CPU/Network bandwidth/HDD ...


18

It depends on some factors. If you're moving the file on the same drive and partition it will be faster to cut/paste than to copy since it's not actually moving the data. If it's across partition or drive boundries it will always be a copy or copy+erase so the difference is minimal.


18

TeraCopy is rated Hive Five Winner for best alternative file copier. I'd say it rates pretty high on your scale-of-intelligence. However, its limited to Windows platforms.


16

For single files you can use tee to copy to multiple places: cat <inputfile> | tee <outfile1> <outfile2> > <outfile3> or if you prefer the demoggified version: tee <outfile1> <outfile2> > <outfile3> < <inputfile> Note that as Dennis points out in the comments tee outputs to stdout as well as the ...


16

There are many ways to copy DVDs and many different programs out there to help with copying DVDs. Since you are using Windows 7 and Windows 7 comes with DVD burning software, I'll show you how to use the software that comes with Windows 7.The steps you took to copy the dvd should have worked. Once you copied all the files to the desktop, put in a blank DVD. ...


15

Maybe your External HDD is formatted as FAT? FAT-formatted drives can't see files larger than 4 GB, you'll have to reformat it as NTFS. The maximum possible size for a file on a FAT32 volume is 4 GB minus 1 byte (232−1 bytes). Video applications, large databases, and some other software easily exceed this limit. Larger files require another formatting ...


15

so far as I know, there is no means of copying a selected area from the putty window to the Windows clipboard without using the mouse. there is a feature request on the putty site specifically for this functionality. http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/keyboard-copy.html the only way to copy information from the putty window to the ...


15

cp -p does the trick.


14

If the links contain relative paths, then, copying the link will not adjust the relative path. Use readlink, with the switch -f to follow recursively, in order to get the absolute path of the link. For example: ln -s $(readlink -f old/dir/oldlink) new/dir/newlink If preserving the relative paths is what you want, than the option -P of cp, as said by ...


14

There's actually a nearly canonical answer by Microsoft's Raymond Chen about this from WAAAAAY back, and there are a few pieces to the puzzle. Because the copy dialog is just guessing. It can't predict the future, but it is forced to try. And at the very beginning of the copy, when there is very little history to go by, the prediction can be really ...


14

You can just copy the files inside the directories you mentioned, that is, the virtual harddisk (.vdi) and the xml-based description of the virtual machine. I did this twice, even cross plattform (a XP geust from an OS X host to a Windows XP host, and an Ubuntu guest from a Windows Vista Host to an OS X host) and it worked fine. There may be two issues: ...


14

Don't put the stick in their computer? Or encrypt the data. But of course you can't access it on their computer then. But whenever the data on your usb stick can be read, it can be copied. If you want to protect yourself against theft of the stick then encryption is the way to go. I recommend portable truecrypt with a file container for this. If you want ...


14

This is normal, you are reading and writing to the same physical disk and it can be even worse if you have a lot of files in a single directory.


14

The reason for this behavior is rather straightforward, and it relates to how files are saved in most Mac OS X applications: Atomically. What happens is that a copy of the file is written to a temporary staging area, and then moved to replace the original file. This, quite naturally, breaks hard links.


13

xcopy is an external program, while copy is part of the interpreter (cmd.exe, command.com). This means that xcopy might not be present on another machine or a rescue disk. Since we have Windows and rescue CDs, that isn't really an issue anymore. copy can concatenate files. copy file1 + file2 file3 creates a file (file3) which contains file1's and ...


13

Just as the man page says, use -P.



Only top voted, non community-wiki answers of a minimum length are eligible