Strange ~ file

Discussion in 'macOS' started by Johnf1285, Dec 29, 2010.

  1. Johnf1285 macrumors 6502a

    Johnf1285

    Joined:
    Dec 25, 2010
    Location:
    New Jersey
    #1
    Sorry if this is mentioned elsewhere, but it was hard to search with this issue.

    Within my "/" directory, there is a file named "~"... Does anyone have any more information on this file?

    This computer had been restored with time machine.

    10.6.5
    imac i3 21.5"
     
  2. Johnf1285 thread starter macrumors 6502a

    Johnf1285

    Joined:
    Dec 25, 2010
    Location:
    New Jersey
    #3
  3. spidey3 macrumors regular

    Joined:
    Jul 1, 2010
    #4
    None of those threads really came up with a cause or solution.

    Who owns the file (root or a user)?
    What is in the file?
    If you delete it, does it come back?
     
  4. xyzzy-xyzzy macrumors member

    Joined:
    Sep 19, 2010
    #5
    '~' at the start of a filename is the conventional filename abbreviation convention used in say, a shell (e.g., bash) to designate the user's home dir. The actual pathname would not have '~' in it unless something wanted that character explicitly as part of the name.

    For example, if you haven't moved your home dir, and your user account (user) is, say, "foo", then a file in "foo", call it, "x", would be located at "/Users/foo/x". You could reference "x" in a terminal shell as "~/x" but that will be processed as "/Users/foo/x".

    So, if you are actually seeing a file with an explicit "~' at the start of it (or that's the entire filename) I am assuming someone (and errant application, a misquoted or mistyped terminal command, or even a mistyped save command typed into some application) created it. Odds are pretty good you can toss it.

    Heh, you could also try double clicking it to see if it launches some possibly associated application :D That might give you an idea of where it came from -- or not!
     

Share This Page