I have a log file on a CentOS system that is taking up 700MB of space (seen using ls
), but when I run the df -h
command, it shows that only 200MB of space is being used on the file system (ext4).
What could be causing this discrepancy?
Is it possible for a file to take up more space than is being reported by df, and if so, how can I tell which files are not using space?
edit: I clicked to fast, the other post don't answer my question. Here is the problem in a simplified form:
# ls -lh /mnt
total 29M
-rw-r--r-- 1 apache apache 678M Jan 6 10:01 Somelog.log
-rw-r--r-- 1 apache apache 1.1M Jan 1 03:20 Somelog.log-20230101.gz
-rw-r--r-- 1 apache apache 1.1M Jan 2 03:23 Somelog.log-20230102.gz
....etc....
du -sh /mnt
29M /mnt
I wan't some information about the file that's not counted in the total. (what's the term used when a file is still in memory ? if that's the case)
ls -lk
command which shows what is actually on disk.-- – julesl Jan 06 '23 at 08:48ls -lk
just show the size in KB instead of Byte. – julesl Jan 06 '23 at 08:53ls -lh /mnt
, but there might be hidden files, and also it's possible for a directory to take up 29MB by itself. – muru Jan 06 '23 at 09:17