How it works...

Now we will see how the preceding commands work:

  1. We used the dd command to copy the contents of the 01.txt file into the 02.txt file.
  2. To run this command, we must have super user privileges. Using the dd command, we took a backup and stored it in the hdbackup.img file.
  3. Using the dd command, we erased the contents of the 1.sh file.

Get Bash Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.