zsh-users
 help / color / mirror / code / Atom feed
From: Dirk Heinrichs <dhs@recommind.com>
To: <zsh-users@zsh.org>
Subject: Hardlinks (was: Re: Does the bash bug have a zsh counterpart?)
Date: Fri, 26 Sep 2014 07:46:58 +0200	[thread overview]
Message-ID: <5424FDD2.5010907@recommind.com> (raw)
In-Reply-To: <30A8659B-9D25-4A83-BCA6-829A25FCA89D@ucsc.edu>

[-- Attachment #1: Type: text/plain, Size: 1606 bytes --]

Am 25.09.2014 um 18:53 schrieb William G. Scott:

> (About 10 years ago I found a hard link to a then nonexistent ksh behaved properly whereas a symbolic link for whatever reason didn’t).

A hardlink is nothing more than another name for the same file. When ksh
was deleted, the system has just deleted that one NAME of the file, but
it stayed there under the other name (sh). That's the reason why you
can't create hardlinks across filesystem borders. BTW: You can identify
hardlinked files by looking at

 1. The link count:
    % touch foo
    % ln foo bar
    % ll foo bar
    -rw-r--r-- 2 someuser users 0 Sep 26 07:36 bar
    -rw-r--r-- 2 someuser users 0 Sep 26 07:36 foo
    % ln bar baz
    % ll foo bar baz
    -rw-r--r-- 3 someuser users 0 Sep 26 07:36 bar
    -rw-r--r-- 3 someuser users 0 Sep 26 07:36 baz
    -rw-r--r-- 3 someuser users 0 Sep 26 07:36 foo
 2. The inode number
    % ll -i foo bar baz
    22 -rw-r--r-- 3 someuser users 0 Sep 26 07:36 bar
    22 -rw-r--r-- 3 someuser users 0 Sep 26 07:36 baz
    22 -rw-r--r-- 3 someuser users 0 Sep 26 07:36 foo

The link count tells you whether a file has multiple names, while the
inode number tells you which names a file has.

A symlink, OTOH, is just a NEW (special) file, pointing to another file
which may exist or not.

HTH...

    Dirk
-- 

*Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
*Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
*Tel*: +49 2226 1596666 (Ansage) 1149
*Email*: dhs@recommind.com <mailto:dhs@recommind.com>
*Skype*: dirk.heinrichs.recommind
www.recommind.com <http://www.recommind.com>

[-- Attachment #2.1: Type: text/html, Size: 2447 bytes --]

[-- Attachment #2.2: Logo.gif --]
[-- Type: image/gif, Size: 1537 bytes --]

  parent reply	other threads:[~2014-09-26  5:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-25 16:35 Does the bash bug have a zsh counterpart? William G. Scott
2014-09-25 16:41 ` Peter Stephenson
2014-09-25 16:45   ` shawn wilson
2014-09-25 16:53   ` William G. Scott
2014-09-25 17:29     ` TJ Luoma
2014-09-26  5:46     ` Dirk Heinrichs [this message]
2014-09-26 15:02       ` Hardlinks (was: Re: Does the bash bug have a zsh counterpart?) William G. Scott
2014-09-25 16:41 ` Does the bash bug have a zsh counterpart? Jérémie Roquet
2014-09-25 16:42 ` shawn wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5424FDD2.5010907@recommind.com \
    --to=dhs@recommind.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).