Rather than looking at two files to compare them, the command line environment gives us tools to evaluate data. Learn how to compare text files quickly and easily.
- [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 use that.…I'll write diff -y and then the first file,…
- Exploring filesystems
- Installing Linux on a physical or virtual machine
- Working with files, directories, and links
- Finding files
- Handling input/output redirection
- Comparing text files and non-text files
- Compressing and decompressing files
- Configuring file permissions
- Managing the root account
- Accessing the command line remotely
- Transferring files
Skill Level Beginner
1. Install and Log Into Ubuntu
System documentation11m 21s
2. Working with Files in the Terminal
3. Security and Administration
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.