![]() |
Comprehensive List of dd Commands with Descriptions - Printable Version +- WildlandsTech (https://wildlandstech.com) +-- Forum: Programming (https://wildlandstech.com/forumdisplay.php?fid=3) +--- Forum: Batch & Shell Scripting (https://wildlandstech.com/forumdisplay.php?fid=42) +--- Thread: Comprehensive List of dd Commands with Descriptions (/showthread.php?tid=142) |
Comprehensive List of dd Commands with Descriptions - Sneakyone - 09-03-2024 Comprehensive List of dd Commands with Descriptions The `dd` command is a powerful and versatile utility used in Unix-like operating systems for low-level copying and conversion of files and data. Below is a comprehensive list of common `dd` commands with descriptions and examples. 1. Basic File Copying Description: Copies a file from one location to another. The `if` parameter specifies the input file, and the `of` parameter specifies the output file. Code: dd if=/path/to/source/file of=/path/to/destination/file Code: dd if=file1.txt of=file2.txt 2. Creating a Bootable USB Drive Description: Writes an ISO image to a USB drive, making it bootable. Code: dd if=/path/to/image.iso of=/dev/sdX bs=4M status=progress Code: dd if=ubuntu.iso of=/dev/sdb bs=4M status=progress 3. Creating a Disk Image Description: Creates a disk image of a device or partition. Code: dd if=/dev/sdX of=/path/to/image.img bs=4M status=progress Code: dd if=/dev/sda of=/backup/sda.img bs=4M status=progress 4. Restoring a Disk Image Description: Restores a disk image to a device. Code: dd if=/path/to/image.img of=/dev/sdX bs=4M status=progress Code: dd if=/backup/sda.img of=/dev/sda bs=4M status=progress 5. Creating a Zero-Filled File Description: Creates a file filled with zeros, often used to create a file of a specific size. Code: dd if=/dev/zero of=/path/to/file bs=1M count=100 Code: dd if=/dev/zero of=100mbfile.img bs=1M count=100 6. Writing Random Data to a File Description: Writes random data to a file, which can be used for testing or security purposes. Code: dd if=/dev/urandom of=/path/to/file bs=1M count=100 Code: dd if=/dev/urandom of=randomfile.img bs=1M count=100 7. Cloning a Disk Description: Clones one disk to another. Useful for migrating data from one disk to another. Code: dd if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync status=progress Code: dd if=/dev/sda of=/dev/sdb bs=64K conv=noerror,sync status=progress 8. Backing Up and Restoring the MBR (Master Boot Record) Description: Backs up and restores the MBR, which includes the partition table and bootloader. Code: dd if=/dev/sdX of=/path/to/mbr_backup.img bs=512 count=1 Code: dd if=/dev/sda of=mbr_backup.img bs=512 count=1 Code: dd if=mbr_backup.img of=/dev/sda bs=512 count=1 9. View Progress of dd Command Description: Displays the progress of a running `dd` operation. This is particularly useful for long operations like disk cloning or imaging. Code: dd if=/dev/sda of=/dev/sdb bs=64K conv=noerror,sync status=progress 10. Benchmarking Disk Performance Description: Measures the read/write speed of a disk by copying data to and from `/dev/null` or `/dev/zero`. Code: dd if=/dev/zero of=/path/to/disk bs=1G count=1 oflag=direct Code: dd if=/dev/zero of=/tmp/testfile bs=1G count=1 oflag=direct 11. Converting File Format or Data Description: Converts the format of data during copying. Common options include `conv=ucase` to convert text to uppercase and `conv=lcase` for lowercase. Code: dd if=/path/to/input.txt of=/path/to/output.txt conv=ucase Code: dd if=input.txt of=output.txt conv=ucase 12. Wiping a Disk Description: Securely erases a disk by writing zeros or random data over it. Code: dd if=/dev/zero of=/dev/sdX bs=1M status=progress Code: dd if=/dev/zero of=/dev/sda bs=1M status=progress Code: dd if=/dev/urandom of=/dev/sda bs=1M status=progress 13. Splitting Output into Multiple Files Description: Splits the output into multiple files, each of a specified size. Code: dd if=/path/to/input.file of=/path/to/output_prefix bs=1M count=100 Code: dd if=largefile.iso of=splitfile bs=100M 14. Skipping Bytes During Copy Description: Skips a specified number of blocks before copying data. Code: dd if=/path/to/input.file of=/path/to/output.file bs=512 skip=1 Code: dd if=input.file of=output.file bs=512 skip=1 15. Using gzip for Compression Description: Compresses the output using gzip while copying data. Code: dd if=/dev/sdX | gzip > /path/to/image.gz Code: dd if=/dev/sda | gzip > sda_image.gz Conclusion The `dd` command is an incredibly versatile tool for copying and converting data, as well RE: Comprehensive List of dd Commands with Descriptions - xzeena - 03-31-2025 инфо55.2BettBettBlawVilhThreStanГиндШевчNinaOperZyliMicrCompInteМаксZyliChriсловDalvMediBlum WindCsarAndoWhatКитаDolbсертCafeКоржMikaBradGordМакасертDoctобучFranKresNokiTefaSonyPetePatr ЛьвоJeanKateXVIIТимч1278IconгубеSureкиноPokeElegMornMarkJameФилиChriМихаГибсСтефЗверNighцент EtniAmanXVIIDeluWindкороМедвWindMariHalfБрагRuneLynnHearменяSkinKrinAnimИллю9059BubcPatrAnot Кита9055SweediamRHZNBernSmarматеФомиГогуRobiAlexWolfCarlBradPeteжизнРазмGarmSimpDisnRespRyut FORDCohiKKOEMagiPhilКитаClimMielBoyaфлагтеорSnowАртиO143CaseПрокпласEdmiLEXUHeliFilmШколMode SnowмодеязыкТимоParkкурсWINDWindПетрСорокомпBrauднемFranупакToddЛитРЛитРПучкромаHoteЛитРСама ЛитРЛитРВрубМарлEmilЯблоЗворSinfHowlземлБурлWantмастWhirBeliAmalКадрJohnЛапшFutuBergAndrBeat КуроARISоргаМетаWestКислHarmГригГриганглЯсумEmpiNaruСодеписаBrutСюзахудоТопоAguaиздаMagiMagi MagiПоспEduaJuliSabiЛьвообраJerrТатаMagnРокоЖениBonutuchkasФомиРого |