课程: Ubuntu Linux: Essential Commands
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Compare text files
- [Instructor] Sometimes, we may need to compare our source code, configurations, logs, or other text files to discover changes. For that, we can use a tool called Diff. Diff shows us the differences between two files. So let's create a text file with a few lines in it. I write vi text1.txt I'll press I to move into Insert Mode and I'll write I'll save and quit by pressing Escape :WQ and I'll make a copy of that file. CP text1.txt text2.txt then I'll open up text2.txt and make a few changes. I'll write vi text2.txt I'll change text1 to text2 and I'll change few to couple of. I'll change short to brief and write to read and I'll add another line. Again, I'll save this with Escape:WQ Now we can use the Diff command to see the differences between text1 and text2. Let's think about what Diff is going to do by envisioning the first file as being on our left and the second file as being on our right. Normally, Diff doesn't actually show this, but with the dash y option, it will, so let's…
内容
-
-
-
-
(已锁定)
Files on Linux10 分钟 27 秒
-
(已锁定)
Text files8 分钟 52 秒
-
(已锁定)
Work with files and directories10 分钟 16 秒
-
File links7 分钟 27 秒
-
(已锁定)
Finding files4 分钟 40 秒
-
(已锁定)
Input/output redirection6 分钟 18 秒
-
(已锁定)
Compare text files4 分钟 43 秒
-
(已锁定)
Compare non-text files3 分钟 20 秒
-
(已锁定)
Compress and decompress files9 分钟 12 秒
-
(已锁定)
Explore regular expressions3 分钟 36 秒
-
(已锁定)
Change files programmatically4 分钟 42 秒
-
(已锁定)
-
-