Solved

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

Posted on 2011-02-18
5
1,397 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delete email that have a topic like  Cpanel 3 69
linux apache localhost dev laptop 5 48
Linux Scripting 3 102
how to rebuild XFS volume from LV 19 38
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…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

867 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now