Unix file tricks

Create dummy file in UNIX
==================

$ dd if=/dev/zero of=testfile count=252400 bs=10240
This will create a 2.5GB file. This can be used to test, if the files system supports 2g+ files.

Changing the existing UNIX file to 0 byte file
$ cat /dev/null > filename

Erasing the disk
===========

dd if=/dev/zero of=/dev/raw/c1t0d7s6 bs=1048576 count=100
The dd utility copies the specified input file to the specified output.

Description for used options:

‘if=file’
Read from file/device.

‘of=file’
Write to file/device.

‘bs=bytes’
Set both input and output block sizes to bytes (1MB in this case).

‘count=blocks’
Copy Number of blocks from the input file

This puts zeroes to the first 100 MB of disk /dev/raw/c1t0d7s6, erasing all information.

Advertisements
This entry was posted in Unix OS and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s