LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-13-2014, 06:25 AM   #1
manpreetmails
LQ Newbie
 
Registered: Apr 2014
Posts: 6

Rep: Reputation: Disabled
'bs' and 'count' operands in #dd command


Hi Frnds,

Can you explain me about 'bs' and 'count' operands in #dd command ?

Code:
dd if=/dev/zero of/home/user1/file1 bs=1024 count=50
Kindly explain me above command. Can bs and count operands be used together? In the above command, it is coping 1024 bytes and 50 blocks from input file ?
 
Old 09-13-2014, 08:16 AM   #2
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
You must specify bs (block size in bytes) and count (number of blocks).
It is likely that a block size which is a multiple of 512 or 4096 is most efficient.
file1 will be 50 kbytes of zeroes.

Note that your command requires an of= parameter - you are missing the '='

Note that dd is considered a highly dangerous command - a small slip can be disastrous.
 
Old 09-14-2014, 05:22 AM   #3
manpreetmails
LQ Newbie
 
Registered: Apr 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks for your reply. I understood. I am using it for testing purpose only.

I am trying to set quota for user named "geet".
I have used 'edquota' command for set quota and I used soft limit as 50 and hard limit as 90.
When I executed below command, it did not give me warning message or restrain me from creating file with that size and file is being copied. Can you tell me what could be wrong ?

#dd if=/dev/zero of=/home/geet/testfile bs=1024 count=100
 
Old 09-14-2014, 06:02 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by JeremyBoden View Post
You must specify
no, you don't have to.
if you omit bs, dd chooses some default size, if you omit both, dd just keeps on writing til the disk is full. if the input file is endless, like /dev/null.

Quote:
Originally Posted by manpreetmails View Post
I am trying to set quota for user named "geet".
I have used 'edquota' command for set quota and I used soft limit as 50 and hard limit as 90.
When I executed below command, it did not give me warning message or restrain me from creating file with that size and file is being copied. Can you tell me what could be wrong ?
this is not specific to dd anymore and you really have to tell us what you're talking about.
my system does not have an "edquota" command.
what are you trying to test/achieve, on what system?
please read the first link in my signature.
 
Old 09-14-2014, 09:29 AM   #5
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
You could install the quota package or use one of the ways in http://www.linuxtopia.org/online_boo...ers.html#Quota
 
Old 09-14-2014, 01:17 PM   #6
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 529

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by manpreetmails View Post
Thanks for your reply. I understood. I am using it for testing purpose only.

I am trying to set quota for user named "geet".
I have used 'edquota' command for set quota and I used soft limit as 50 and hard limit as 90.
When I executed below command, it did not give me warning message or restrain me from creating file with that size and file is being copied. Can you tell me what could be wrong ?

#dd if=/dev/zero of=/home/geet/testfile bs=1024 count=100
When you executed that command, were you logged in as geet? I believe the quota is enforced per user or group, not per home directory. If you are logged in as root, try this:
Code:
# su geet
$ dd if=/dev/zero of=/home/geet/testfile bs=1024 count=100
Edit: In case you are not familiar with su, I should mention that you go back with the exit command:
Code:
# whoami
root
# su geet
$ whoami
geet
$ exit
# whoami
root
#

Last edited by Beryllos; 09-14-2014 at 01:31 PM.
 
Old 09-24-2014, 02:48 AM   #7
manpreetmails
LQ Newbie
 
Registered: Apr 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks Beryllos! That helped.
I was not logged in as geet while executing command. Thanks for your help.

Thanks Ondoho for your reply.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vim count command Snaggletooth Linux - Newbie 4 02-09-2011 03:13 AM
Is there a command to count inodes with in a directory? abefroman Linux - Server 2 07-16-2010 10:16 PM
Command to count all characters in file. guif Linux - Newbie 4 03-26-2010 08:44 AM
Need help in word count command grunge_1 Linux - General 4 03-20-2009 04:01 AM
command to count how many lines in a file? dr_zayus69 Linux - Software 3 01-06-2005 10:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration