×

Loading...
Ad by
  • 予人玫瑰,手有余香:加拿大新天地工作移民诚聘求职顾问&行业导师!
Ad by
  • 予人玫瑰,手有余香:加拿大新天地工作移民诚聘求职顾问&行业导师!

one question in Unix

Once i empty a log file by using " > aaa.log" , the size of that file should turn to 0 immediately.

But strange thing happened today. One of the filesystems was full today and i found there had a very huge log file in it.
So i use " > aaa.log" to empty it.
After that, the command seemed to take effect because the used blocks dropped down and the used percent of the whole disk returned to normal.

But when I tried to take a look at that file, i was astonished that the size of that file didin't change and I can still cat that file's content while the filesystem was almost empty.

Who can explain this problem to me? thanks!
Report

Replies, comments and Discussions:

  • 枫下家园 / 电脑用户 / one question in Unix
    Once i empty a log file by using " > aaa.log" , the size of that file should turn to 0 immediately.

    But strange thing happened today. One of the filesystems was full today and i found there had a very huge log file in it.
    So i use " > aaa.log" to empty it.
    After that, the command seemed to take effect because the used blocks dropped down and the used percent of the whole disk returned to normal.

    But when I tried to take a look at that file, i was astonished that the size of that file didin't change and I can still cat that file's content while the filesystem was almost empty.

    Who can explain this problem to me? thanks!
    • up
    • I erver had this problem 5 years ago, try to delete this log file , create a new log file. I cannot remember the cause, maybe the mult-process share rule.
      • you mean that some process may still hold that file?
        • right, I ever maintanence a Banking Core system ran on Aix , the application log file very big in case of the online transactions. we alway need check and clear the log file.
          • thanks