sum command in Linux with Examples Last Updated : 14 Oct, 2024 Comments Improve Suggest changes Like Article Like Report The sum command in Linux is used to calculate the checksum and block count of files. This command helps in verifying file integrity by comparing the calculated checksum with an expected value. The sum command can operate on one or more files, and when no file is specified, it reads from standard input.SyntaxThe general syntax for the sum command is as follows:sum [OPTION]... [FILE]...Basic ExampleIt will ask for the input of the file we want to calculate the checksum. In the following example, we calculate the checksum for "myfile.txt".Key Options used with the sum command1. sum -r Uses the BSD algorithm, with 1K blocks. This is useful when working in environments that prefer BSD-style checksum algorithms. Example:sum -r myfile.txt2. sum -sUses the System V algorithm, with 512-byte blocks. This option is commonly used in older systems that rely on the System V algorithm.Example:sum -s myfile.txt 3. sum --helpDisplays help text with a list of all options and exits.Example:sum --help4. sum --versionShows version information of the sum command and exits.sum --versionOptionDescription-rUses the BSD algorithm with 1K blocks. Suitable for environments that rely on the BSD-style checksum.-sUses the System V algorithm with 512-byte blocks. Useful for older systems with the System V algorithm.--help Displays help text with a list of options.--versionShows the version information of the sum command.ConclusionThe sum command is a simple yet powerful tool for verifying file integrity in Linux systems. By using options such as -r and -s, you can choose different algorithms and block sizes based on your requirements. Whether you're verifying file downloads or automating checksum verification, sum is an essential command to know. Comment More infoAdvertise with us R rahulkumarmandal Follow Improve Article Tags : Linux-Unix linux-command Linux-file-commands Similar Reads shutdown command in Linux with Examples The `shutdown` operation in Linux is a crucial command for managing system power states, allowing administrators to halt safely, power off, or reboot the system. This command provides flexibility in scheduling downtimes, ensuring minimal disruption to users and processes. In this article, we will ex 5 min read sleep Command in Linux with Examples sleep command is used to create a dummy job. A dummy job helps in delaying the execution. It takes time in seconds by default but a small suffix(s, m, h, d) can be added at the end to convert it into any other format. This command pauses the execution for an amount of time which is defined by NUMBER 5 min read source Command in Linux with Examples If you're new to the world of Linux, you might have heard about commands that do various tasks, but some like the 'source' command might seem a bit confusing at first. Don't worry; let's break it down step by step.What is the Source Command?The source command in Linux is like a magic wand that lets 7 min read How to sort lines in text files in Linux | sort Command The sort command in Linux is used to sort a file, arranging the records in a particular order. By default, the sort command sorts file assuming the contents are ASCII. Using options in the sort command can also be used to sort numerically.sort is a command that sorts text files alphabetically, numer 7 min read Split Command in Linux with Examples Split command in Linux is used to split large files into smaller files. It splits the files into 1000 lines per file(by default) and even allows users to change the number of lines as per requirement. The names of the files are PREFIXaa, PREFIXab, PREFIXac, and so on. By default the PREFIX of files 6 min read How to use SSH to connect to a remote server in Linux | ssh Command Secure Shell, commonly known as SSH, is like a super-secure way to talk to faraway computers, called servers. It's like a secret tunnel on the internet that keeps your conversations safe and private. Imagine you're sending a letter, and instead of sending it openly, you put it in a magic envelope th 8 min read Strace command in Linux with Examples 'strace' is a powerful tool for monitoring and diagnosing processes in Linux. It is primarily used for debugging programs, troubleshooting issues, intercepting and recording system calls, and tracing running processes. It provides valuable insights into how a program interacts with the system, espec 4 min read stty command in Linux with Examples stty command in Linux is used to change and print terminal line settings. This command shows or changes terminal characteristics. Syntaxstty [-F DEVICE | --file=DEVICE] [SETTING]...stty [-F DEVICE | --file=DEVICE] [-a|--all]stty [-F DEVICE | --file=DEVICE] [-g|--save]where,-F DEVICE or --file=DEVICE 2 min read sudo Command in Linux with Examples sudo (Super User DO) command in Linux is generally used as a prefix for some commands that only superusers are allowed to run. If you prefix any command with "sudo", it will run that command with elevated privileges or in other words allow a user with proper permissions to execute a command as anoth 8 min read sum command in Linux with Examples The sum command in Linux is used to calculate the checksum and block count of files. This command helps in verifying file integrity by comparing the calculated checksum with an expected value. The sum command can operate on one or more files, and when no file is specified, it reads from standard inp 3 min read Like