Lesson 12 of 15

Copy in Place, Compare, Sync Folders

Duration: 3:36 Watch on YouTube (external link, opens in new tab)

Markdown version

In this lesson

Roy copies a file in the same folder under a new name with Shift-F5, edits it and compares the two files by content, with options to ignore white space and case. He then compares a testing and a production directory with Mark, Compare directories, and synchronizes them with Commands, Synchronize directories, which shows what is different, duplicate or single on each side and what will be copied where. Shift-F4 creates a new text file and starts editing it.

Transcript

562 words

[00:02] (external link, opens in new tab) Okay, let's talk more about files. And this time we're going to try to So, I'm going to try to show some nice shortcuts when working with files. For example, copy in place. So, I let's say I want to create a copy of contact here, but in the same folder. So, I'm going to press shift F5 instead of just F5 to copy to the other side. I'm going to press shift F5. Which will allow me to change the loc to change the name of it and create a new copy. I'm going to call it contact 2. And now I'm going to press F4 to change it with something.

[00:37] (external link, opens in new tab) Let's say XPCX. I'm going to save that. And what we're going to see is that we can actually compare two files. How do we compare two files? Going to select one file here and the other file here. Or we can select two files in the same location. Contact and contact two and go to files compare by content.

[01:10] (external link, opens in new tab) And we can see the difference between those two immediately. So if you're looking for a comp comparison tool, you can ignore white spaces in case sensitivity etc. Total Commander also has rudimentary support for comparing directories. So let's say I want to compare testing directory on the left here. I'm going to enter it and then the production directory on the right. I'm going to enter that too. And then I'll go to mark compare directories. And what's going to happen is that it's going to show the files that are different from each of the folders.

[01:44] (external link, opens in new tab) And this is helpful just to see now we can try to compare these two things. But if we truly want to do synchronization between directories, there's a command for that. We can just be in these two different directories, say testing on one side, production on the other. We can go to commands, synchronize directories, and that will give us this comparison tool, which also tells us which also allows us to select what will go where. So we can show what's different, what's duplicate, what's single on each side.

[02:18] (external link, opens in new tab) It will tell us what's going to happen when you actually do the synchronization so that both directories will be the same. So if I click synchronize here, this file is going to be copied to the right. This file is going to be copied to the left. Let's do that. Are you sure you want to do that? Yes. You sure you want to override that file? Yes. And sometimes you might need to do more checking before you do the synchronization. But you can also say ignore date, ignore content or compare only by date only by content etc.

[02:51] (external link, opens in new tab) So it's a very powerful tool. One last trick I want to show you is how to create a file a text file right where you are. So if let's say I want to create a new text file in this folder, I'm going to press shift F4. Remember F4 is to edit something. Shift F4 is to create and start editing something. So, shift F4. Let's give it a name. In this case, it might be something.txt.

[03:23] (external link, opens in new tab) And I have this file. I'm going to close, save it, and immediately I see this file right here. Nice and simple.