English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Il comando diffstat di Linux mostra i numeri di statistica in base ai risultati di diff.
diffstat legge l'output di diff e poi conta le differenze di inserimento, rimozione, modifica e altri metodi di differenza.
diff [-wV][-n <lunghezza del nome del file>][-p <lunghezza del nome del file>]
Parametro:
Users can also directly use "|" to pass the output of the diff command directly to the diffstat command for the display of the statistical results.
Using this command, if the file or subdirectory to be compared is not in the current directory, you should use its complete path.
$ diff test1 test2 | diffstat #display statistics of comparison results
Note: Using this command can very conveniently realize the function of displaying statistics.
To view the content of a file, users can view it by using the command "cat", as follows:
$ cat test1/testf.txt #view content of test1/testf abc def ghi jkl mno pqr stu vws $ cat test2/testf.txt #view content of test2/testf abc def ghi jkl mno
From the file content displayed above, you can see the differences between the contents of two files. Now let's run the command just now to display the statistics of the file comparison results, as follows:
testfile | 2 +- #output information statistics file changed 1, insertion +1, deletion -1