Score:0

Why is the size of a symlink equal to the size of it's path string?

lv flag

I've read a different question regarding this where the answer was that a symlink stores the name and target + a few bytes for other metadata.

Using "ls -l dir" on ext4, why does the symlink size always equal to the length of the string path of the file it links to?

I've tried it with multiple different paths, different file names, different files, etc.

The size of its symlink always equaled the length of the path string.

Is it maybe because the file size is too small?

Is this the actual length of the content of the symlink file?

Score:1
vn flag

Because the actual symlink file only contains its target, and nothing more.

The metadata (including that this is a symlink file) is not stored within the file itself for most filesystems (including ext4).

Also see this answer.

Navy avatar
lv flag
Thank you, that was really helpful
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.