What is the difference between cat and vim command to file system?

Sucan Zhang bitzsk at gmail.com
Wed Jun 10 11:57:33 UTC 2009


Thank you !

when use vim command the block number will change. but when use echo
"something" > a file. the block number will not change.

zsk at zsk-laptop:~$ sudo filefrag -v a
Checking a
Filesystem type is: ef53
Filesystem cylinder groups is approximately 104
Blocksize of file a is 4096
File size of a is 13 (1 blocks)
First block: 3013938
Last block: 3013938
a: 1 extent found
zsk at zsk-laptop:~$ cat a
hello,world!
zsk at zsk-laptop:~$ vim a
zsk at zsk-laptop:~$ cat a
hi,hello,world!
zsk at zsk-laptop:~$ sudo filefrag -v a
Checking a
Filesystem type is: ef53
Filesystem cylinder groups is approximately 104
Blocksize of file a is 4096
File size of a is 16 (1 blocks)
First block: 3013924
Last block: 3013924
a: 1 extent found


2009/6/10 Stephen Samuel (gmail) <darkonc at gmail.com>

> an example test case might be useful.
> I'm not clear what you're trying to do, or what the problem is.
>
> On Tue, Jun 9, 2009 at 10:40 PM, Sucan Zhang <bitzsk at gmail.com> wrote:
>
>> Hi,
>>
>> why use cat command to edit a file , the blocks of the file will not
>> change.
>>
>> but use vim command to edit a file, the blocks of the file will change?
>>
>> Thanks in advance!
>>
>> --
>> Regards,
>> Sucan
>>
>> _______________________________________________
>> Ext3-users mailing list
>> Ext3-users at redhat.com
>> https://www.redhat.com/mailman/listinfo/ext3-users
>>
>
>
>
> --
> Stephen Samuel http://www.bcgreen.com  Software, like love,
> 778-861-7641                              grows when you give it away
>



-- 
Regards,
Sucan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/ext3-users/attachments/20090610/d81cbd3f/attachment.htm>


More information about the Ext3-users mailing list