🖥️cmp
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the cmp command with important options and switches using examples.
2 minute read
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗███╗ ███╗██████╗
# ██╔════╝████╗ ████║██╔══██╗
# ██║ ██╔████╔██║██████╔╝
# ██║ ██║╚██╔╝██║██╔═══╝
# ╚██████╗██║ ╚═╝ ██║██║
# ╚═════╝╚═╝ ╚═╝╚═╝
Cmp
The cmp command is used to perform byte-by-byte comparison of two files.
$ cmp file1 file2
file1 file2 differ: byte 1, line 1
#######################
# cmp command
# The 'cmp' command lets you carry out byte-by-byte comparison of two files. The utility provides several features in the form of command line options. In this tutorial, we will discuss some of the key options that'll give you (a beginner) a good idea about how the tool works.
cmp -b file1.txt file2.txt
# Make cmp print differing bytes
cmp -i 10 file1.txt file2.txt
# Make cmp skip some initial bytes from both files
cmp -i 4:7 file1.txt file2.txt
# Moving on, the tool also allows you to skip different number of bytes from both files.
cmp -l file1.txt file2.txt
# Make cmp display byte position (and value) for all differing bytes
cmp -n 25 file1.txt file2.txt
# Limit number of bytes to be compared
pv file1.txt | cmp -l file3.txt > output.txt
# Display progress meter while using cmp command
cmp -s file1.txt file2.txt
# The tool also allows you to suppress the output it produces normally. This can be done using the -s command line option.
#==============================##==============================#
# CMD cmp #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command cmp in a clear format. This allows users to quickly access the needed information for cmp without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for cmp are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.