[dd][Linux] Learning Linux commands: dd
Learning Linux dd command with examples | |
---|---|
Linux command syntax | Linux command description |
File systems | |
| Fills the drive with random data |
|
|
| Clean up a hard drive (may need to be repeated) |
| Copy from file to tape device |
| The above, reversed |
| Check if drive is really zeroed out |
| Fills out a partition (careful with system partitions!) |
| Scramble a file (maybe before deleting it) |
| Copy a partition to another partition |
| View available filesystems |
| View availble partitions in kb |
| Creates a gzipped image of the second partition of the second disk |
| Copy the contents of a tape drive to a file, converting from EBCDIC to ASCII |
| Copy from 1KB block device to 2KB block device |
| Copy 10 GB of zeros to the garbage can. |
| Erase GPT from disk. Since GPT writes data at the beginning AND at the end of the drive, after erasing from the beginning, we need to find out the number of sectors (second command), then erase the last 20 sectors. |
| Create bootable USB drive (here shown as /dev/sdc) |
| A good way to check for bad blocks |
Backup and system-related | |
| Copies the MBR to a floppy |
| Drive-to-drive duplication |
| Create an image of a CD |
| Mount said image locally |
| Useful when replacing a disk with another of identical size |
| Create DVD images of a partition (useful for backing up) |
| Restore from above backup |
| Destroy the superblock |
| Another way to destroy the superblock |
| Check file for viruses (needs ClamAV) |
| Look at the contents of a binary file (needs hexdump) |
| Benchmarks hard drive for read/write speed |
| Gives new life to older hard drives that haven't been used for a while (disk must be unmounted) |
| Examine memory contents (human-readable, that is) |
| Copy a floppy disk |
| View virtual memory |
| View available filesystems |
| View loaded modules |
| View interrupt table |
| View uptime in seconds |
| View availble partitions in kb |
| View memstats |
| Creates a 1kb file of random gibberish |
| Creates an image of the actual state of your system memory |
| Prints the file to stdout |
| Search an entire partition for a string; even if it's secured, you can boot a liveCD |
| Copy file.bin to convfile.bin skipping the first 64 kB |
| Create bootable USB drive (here shown as /dev/sdc) |
| Read BIOS. |
| Convert Nero image into ISO standard image. This is possible because the only difference between the two is a 300 kB header Nero adds to a standard ISO file. |
| Try it, it's safe. :-) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Clear first 10MB of the partition |
| Create temporary swap space |
| Determine sequential I/O speed of your drive. Reading 1GB file |
| Generate random number |
| Copy RAM memory to a file |
| See content of your MBR in hex and ASCII format |
| Restore MBR without disturbing partition table record which is between 447 - 511 bytes |
| Create a partition copy and save images where maximum volume size is 700MB |
Text manipulation | |
| Convert the output of a command to uppercase |
| Convert any text to lowercase |
| Convert the system password file to fixed-length EBCDIC-format file |
| Convert from ASCII to EBCDIC |
| Convert a file to uppercase (simple sed or tr replacement) |
Reference :
0 意見:
張貼留言