i create a file using dd command like this:
dd if=/dev/zero of=1g.dd bs=1M count=512 seek=512
when i run command ls 1g.dd, its size is 1G, run du 1g.dd, it's 512M.
there is a struct stat in c library to read file size, but it can only read out that 1G size, now how can i get that 512M size which is the real size of that file?
now the only way i know is to parse shell command du's output.
Is there a way to use the find command to recursively scan directories for files greater than 1Gb in size and print out the directory path and file name only?
Thanks in advance.
While backing up some data (a 200 GB home directory) with rsync, I got an I/0 error for a particular file, after which rsync continued on "normally" with its backup. The problem source file showed as having a file size of 72 bytes.
I cancelled rsync, and ran the same command again. This time that same file showed to be transferring data.. lots of data ...and more data, and more...
Hi there, am new to linux and shell script,am trying to write a shell script to find the size of a particular log file and if the log size grows, script should mail the changes to the administrator or a any user so script should monitor the log file continuously in a time interval, how can i do that?
Hello,
I want remove files have same size in a directory.
this command only find this files.
Code:
ls -l | awk '$1!~/^d/{if(size[$5]!=""){ print}size[$5]=$8}'
I want to remove the files of the same size.
samples: 5 files are same size. I want to keep only first file.
Thank you very much for your help.
I need to know how we can find the size of the kernel routing table.
I have knowledge that the routing table is stored in /proc/net/route
I am presently using wc to count the number of characters in this routing file.
I'm using zfs on my FreeBSD 9.0 x64 and pretty happy with it, but I find it hard to count directory real, not compressed, size.
I need to get the file information (name, size, date modified) of about 1M+ files on a system.
The command I am currently using is:
sudo find "$FULFILLMENT" "$ARCH1" "$ARCH2" "$MASTERING" -type f -exec ls -lT {} +
Is there a way to improve this?
I've 2 configuration files in linux. One file size is 177bytes and 2nd one is 183 bytes.
Checked size by following command:
wc -c Config
both files have 100% same text, same name (different folders). I matched word by word as there are only 6 lines. Also compared by using CompareIT in windows. Now problem is that when I run my program with Config file of 177 bytes, then it works.