Solved

dd if=/dev/null of=sparse-file-1 bs=1M seek=100352

Posted on 2011-02-18
5
1,408 Views
Last Modified: 2012-06-27
i can't not interpret this command, what will it do


dd if=/dev/null of=sparse-file-1 bs=1M seek=100352
0
Comment
Question by:aashee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 11

Expert Comment

by:rowansmith
ID: 34931086
It will create a empty file called "sparse-file-1" of size 1Mb

0
 
LVL 11

Expert Comment

by:rowansmith
ID: 34931096
rowan@daedalus:~/dd$ dd if=/dev/null of=sparse-file-1 bs=1M seek=100352
0+0 records in
0+0 records out
0 bytes (0 B) copied, 2.1698e-05 s, 0.0 kB/s
rowan@daedalus:~/dd$ ls -la
total 8
drwxr-xr-x  2 rowan users         4096 2011-02-19 11:50 .
drwxr-xr-x 14 rowan users         4096 2011-02-19 11:50 ..
-rw-r--r--  1 rowan users 105226698752 2011-02-19 11:50 sparse-file-1
0
 

Author Comment

by:aashee
ID: 34931132
Hi Rowan,
but doesn't it checks some condition and then it iwll create file .
like if=/dev/null ? what does mean by if=/dev/null
what does doea mean by of=sparse-file-1

bs=1M ?

seek=100352, what does it explain?
i want to have a deep understanding of this ?
0
 
LVL 31

Expert Comment

by:farzanj
ID: 34931133
if : means input file.  /dev/null is Unix/Linux file.  It is a special file that provides no data if you read from it and destroys all data when you write to it but returns success.

of: output file.  Path of file to be created
bs: Block size
seek: Skip 100352 byte blocks before copying from if to of
0
 
LVL 11

Accepted Solution

by:
rowansmith earned 500 total points
ID: 34931164
No, it does not check any condition.

What happens is it skips the first 100352 blocks of the output file and starts writing the contents of /dev/null at that point.  /dev/null is empty.  Your block size is 1Mbyte (given by bs=1M)

So 100352 * 1024 * 1024 = 105226698752 bytes of nothing.

It dosn't actua;ly take up that space but,because dev/null is empty.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question