You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The simplest command to do that is to run du -h /*. The user can add sort -n to get the highest.
One can also us ls -lshR to search recursively.
(R for recursive, l for long list format, s for size, h for human readable)
Note: I didn't use df -h to find the partition first because it might the case there are multiple medium sized file in a partition all adding up to 11G but that doesn't mean this partition has the largest single file with size 10G
The text was updated successfully, but these errors were encountered:
Description
An exercise for the candidates to find the largest files on the filesystem on Linux.
Steps to setup
create a big file, there are many options -
truncate
ordd
are most common but not limited.dd if=/dev/zero of=/path/to/largefile bs=4k count=10G
OR
truncate -s 10G /path/to/largefile
(s for size)
Find the largest file
The simplest command to do that is to run
du -h /*
. The user can addsort -n
to get the highest.One can also us
ls -lshR
to search recursively.(
R
for recursive,l
for long list format,s
for size,h
for human readable)Note: I didn't use
df -h
to find the partition first because it might the case there are multiple medium sized file in a partition all adding up to 11G but that doesn't mean this partition has the largest single file with size 10GThe text was updated successfully, but these errors were encountered: