Cmp (Unix)
cmp là một tiện ích sử dụng giao diện dòng lệnh của Unix hay hệ điều hành giống Unix. Chương trình so sánh hai tập tin và xuất…
cmp là một tiện ích sử dụng giao diện dòng lệnh của Unix hay hệ điều hành giống Unix. Chương trình so sánh hai tập tin và xuất kết quả ra thiết bị đầu ra chuẩn. Mặc định, cmp không có thông báo gì nếu các tập tin giống nhau, nếu khác nhau thì hiện ra số dòng nơi đầu tiên mà hai tập tin có dữ liệu khác biệt.
Tham số tùy chọn
Dưới đây liệt kê các tùy chọn của phiên bản GNU cmp:
-b, --print-bytes- Xuất ra các bytes khác nhau.
-i SKIP, --ignore-initial=SKIP- Bỏ qua byte SKIP đầu tiên từ đầu vào.
-i SKIP1:SKIP2, --ignore-initial=SKIP1:SKIP2- Bỏ qua byte SKIP1 đầu tiên từ FILE1 và byte SKIP2 đầu tiên từ FILE2.
-l, --verbose- Xuất ra số byte và giá trị các byte khác nhau.
-n LIMIT, --bytes=LIMIT- So sánh nhiều nhất LIMIT bytes.
-s, --quiet, --silent- Không xuất ra gì, chỉ cho giá trị trả về.
-v, --version- Xuất ra thông tin phiên bản.
--help- Xuất ra thông tin trợ giúp.
Giá trị trả về
- 0 - các tập tin giống nhau
- 1 - các tập tin là khác nhau
- 2 - tập tin không thể truy cập hoặc thiếu tham số
Xem thêm
Tham khảo
Liên kết ngoài
- : compare two files – Commands & Utilities Reference, The Single UNIX® Specification, Issue 6 from The Open Group
- Comparing and Merging Files: Invoking cmp Lưu trữ ngày 26 tháng 12 năm 2008 tại Wayback Machine The section of the manual of GNU cmp in the diffutils free manual.
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.