Linux common commands-77: diff

The diff command compares text files for similarities and differences line by line. If a folder is specified, diff will only compare files with the same filename in the directory, but not subdirectories within it.

Syntax format: diff [parameter] [directory]

Common parameters:

Example

 diff test1.py test2.py

Among them, "<" means that test2.py has one line less than test1.py , ">" means that test2.py has one more line than test1.py

This article is reprinted from https://xugaoxiang.com/2022/06/26/linux-cmds-77-diff/
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment