Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-02-18
5
Medium Priority
?
1,451 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 2000 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

CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

Question has a verified solution.

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

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

715 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