On 22 Jan 2021, at 09:07, Ron Garret (gmail) <ron.garret@gmail.com> wrote:
On Jan 22, 2021, at 8:02 AM, @lbutlr <kremels@kreme.com> wrote:
On 21 Jan 2021, at 18:08, MRob <mrobti@insiberia.net> wrote:
Hello, I just found user who has single folder (standard maildir format) that filled with over 8mil files and 800GB in the /tmp subdirectory of that folder:
Are they real files or hard links?
How would you distinguish a hard link from a “real file”?
ls -l will show the number of hard links to a file in the first column after the permissions (or it showed the number off files (including . and ..) inside a directory if it's a directory entry).
#v+ 10:58:53 :/ $ touch test.file 10:59:03 :/ $ ls -lsn total 0 0 -rw-r--r-- 1 502 0 0 Jan 22 10:59 test.file 10:59:09 :/ $ ln test.file mynewfile 10:59:19 :/ $ ls -lsn total 0 -rw-r--r-- 2 502 0 0 Jan 22 10:59 mynewfile -rw-r--r-- 2 502 0 0 Jan 22 10:59 test.file ^ number of hard links 11:04:18 :/ $ ls -lnd . drwxr-xr-x 4 502 0 128 Jan 22 10:59 /tmp/test/. ^ number of files #v-
There are other ways, including the stat command.
-- Rent a flat above a shop, cut your hair and get a job, smoke some fags and play some pool, pretend you never went to school and still you'll never get it right cuz when you're lay'n in bed at night watching roaches climb the wall if you called your dad he could stop it all.