Sponsored Content
Top Forums Programming Size of a directory or a file Post 302932165 by cjcox on Monday 19th of January 2015 02:58:32 PM
Old 01-19-2015
I'm going to guess that truncate sets up a sparse file... so it has "size" but it's doesn't occupy space Smilie

Try dd instead to create a file.

Code:
dd of=MytestFile.txt bs=1M count=16 if=/dev/zero

@jliagre, sorry, I was in mid post before I saw your post... but great minds think alike.
This User Gave Thanks to cjcox For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to calculate file's size in directory and subdirectory

Hi, I have written one script to calculate total space of all file in one directory, ignoring subdirectory, it works fine. Now, I've been trying to calculate all files which includes files in any subdirectories. I use recursive function to do this, but it can work only if there is only one... (4 Replies)
Discussion started by: KLL
4 Replies

2. Shell Programming and Scripting

How to know size of file in a directory

Hi, I have to directory /usr/inbound ------------- 10900.txt 10889.txt 109290202.txt I need to create inbound directory and i need to know size of these files one by one if file size is zero i need to print message like "empty file" Please help me how to solve this thanks krish. (1 Reply)
Discussion started by: kittusri9
1 Replies

3. Shell Programming and Scripting

How to compare size of two file which is in one directory

I have two file in a Directory.I want a script which will compare the Size of Two file. Can Anyone Help me on this: linasplg11:/opt/dataout/kk/linasplg11 # cat size -rwxrwxrwx 1 root root 16658 Jan 8 13:58 lina_IP_SIP_1231325621210.xml -rwxr-xr-x 1 root root 16672 Jan 8 14:30... (1 Reply)
Discussion started by: Aditya.Gurgaon
1 Replies

4. UNIX for Dummies Questions & Answers

Sort by size, then list file in each directory

Hi, I have directories with name like: aaa bbb ccc ... I would like to to see which directories are the largest and then list the files within each. I have success using: du -ks * | sort -rin | head -n 20 which gives me an output like: 120 bbb 27 ccc 3 aaa ... I would like... (3 Replies)
Discussion started by: ChatPerdu
3 Replies

5. Shell Programming and Scripting

get file size by date for a directory

Good day Probably a simple script though I am new to attempting to script. I have a directory that I would like to get the size of the files and number of files for each date ie 14 Sep 669 files 1.8g 12 Sep 221 files 500mb Any ideas? Thanks (1 Reply)
Discussion started by: ibaboomer
1 Replies

6. Shell Programming and Scripting

Size of file and directory

Hello. I do have a problem. The statement sounds like this: Given a directory, find all subdirectories (regardless of depth) which contain a file that has more than a half of the size of the respective subdirectory. I've tried to solve this in many ways, but all I came up with is half... (1 Reply)
Discussion started by: WorkOfArt
1 Replies

7. Solaris

Directory size larger than file system size?

Hi, We currently have an Oracle database running and it is creating lots of processes in the /proc directory that are 1000M in size. The size of the /proc directory is now reading 26T. How can this be if the root file system is only 13GB? I have seen this before we an Oracle temp file... (6 Replies)
Discussion started by: sparcman
6 Replies

8. Shell Programming and Scripting

How to delete some of the files in the directory, if the directory size limits the specified size

To find the whole size of a particular directory i use "du -sk /dirname".. but after finding the direcory's size how do i make conditions like if the size of the dir is more than 1 GB i hav to delete some of the files inside the dir (0 Replies)
Discussion started by: shaal89
0 Replies

9. UNIX for Dummies Questions & Answers

Ls directory size reporting byte size instead of file count

I have been searching both on Unix.com and Google and have not been able to find the answer to my question. I think it is partly because I can't come up with the right search terms. Recently, my virtual server switched storage devices and I think the problem may be related to that change.... (2 Replies)
Discussion started by: jmgibby
2 Replies

10. UNIX for Beginners Questions & Answers

Sort by file/directory size

OS : RHEL 6.6 I want to list the files/directories sorted (Ascending or Desceding) by their size. As you can see in the below example, du command doesn't sort by size. In Linux world, is there any other command or workaround using du command to list the files/directories sorted by their... (6 Replies)
Discussion started by: John K
6 Replies
ib_write_bw_postlist(1) 					   User Commands					   ib_write_bw_postlist(1)

NAME
ib_write_bw_postlist - RDMA write post list bandwidth test SYNOPSIS
ib_write_bw_postlist [ options ] [ server IP address ] DESCRIPTION
This program tests the bandwidth of RMDA write transactions. OPTIONS
-p, --port=<port> listen on/connect to port <port> (default 18515) -d, --ib-dev=<dev> use IB device <dev> (default first device found) -i, --ib-port=<port> use port <port> of IB device (default 1) -c, --connection=<RC/UC> connection type RC/UC (default RC) -m, --mtu=<mtu> mtu size (256 - 4096. default for hermon is 2048) -g, --post=<num of posts> number of posts for each qp in the chain (default tx_depth) -q, --qp=<num of qp's> Num of qp's(default 1) -s, --size=<size> size of message to exchange (default 65536) -a, --all Run sizes from 2 till 2^23 -t, --tx-depth=<dep> size of tx queue (default 100) -n, --iters=<iters> number of exchanges (at least 2, default 5000) -I, --inline_size=<size> max size of message to be sent in inline mode (default 400) -b, --bidirectional measure bidirectional bandwidth (default unidirectional) -V, --version display version number -F, --CPU-freq do not fail even if cpufreq_ondemand module is loaded AUTHOR
Guy Coates < gmpc@sanger.ac.uk > perftest February 20, 2008 ib_write_bw_postlist(1)
All times are GMT -4. The time now is 12:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy