Question about /bin files

Discussion in 'macOS' started by spikesnet, Apr 11, 2009.

  1. spikesnet macrumors newbie

    Joined:
    Mar 30, 2009
    #1
    Does anyone else have a file called [ and a file called test in /bin? They have timestamps of before I bought my macbook so I dont think I created them by mistake:

    mymacbook:bin bille$ ls -l
    total 18568
    -r-xr-xr-x 1 root wheel 46720 May 31 2008 [
    -rwxr-xr-x 1 root wheel 1244928 May 31 2008 bash
    -r-xr-xr-x 1 root wheel 43296 May 31 2008 cat
    -r-xr-xr-x 1 root wheel 56720 Nov 12 18:37 chmod
    -r-xr-xr-x 1 root wheel 56208 Nov 12 18:37 cp
    -rwxr-xr-x 1 root wheel 610864 May 31 2008 csh
    -r-xr-xr-x 1 root wheel 56096 May 31 2008 date
    -r-xr-xr-x 1 root wheel 59776 Nov 12 18:37 dd
    -r-xr-xr-x 1 root wheel 51440 Nov 12 18:37 df
    -r-xr-xr-x 1 root wheel 38336 Oct 16 01:19 domainname
    -r-xr-xr-x 1 root wheel 38320 May 31 2008 echo
    -r-xr-xr-x 1 root wheel 114000 May 31 2008 ed
    -r-xr-xr-x 1 root wheel 46944 May 31 2008 expr
    -r-xr-xr-x 1 root wheel 38416 May 31 2008 hostname
    -r-xr-xr-x 1 root wheel 38640 May 31 2008 kill
    -r-xr-xr-x 1 root wheel 1955856 May 31 2008 ksh
    -rwxr-xr-x 1 root wheel 133312 Oct 16 00:51 launchctl
    -r-xr-xr-x 1 root wheel 38784 Nov 12 18:38 link
    -r-xr-xr-x 1 root wheel 38784 Nov 12 18:38 ln
    -r-xr-xr-x 1 root wheel 73696 Nov 12 18:38 ls
    -r-xr-xr-x 1 root wheel 38640 Nov 12 18:38 mkdir
    -r-xr-xr-x 1 root wheel 47712 Nov 12 18:38 mv
    -r-xr-xr-x 1 root wheel 218656 Nov 12 18:38 pax
    -rwsr-xr-x 1 root wheel 85536 May 31 2008 ps
    -r-xr-xr-x 1 root wheel 38400 May 31 2008 pwd
    -r-sr-xr-x 1 root wheel 56208 Oct 16 01:20 rcp
    -r-xr-xr-x 1 root wheel 47648 Nov 12 18:38 rm
    -r-xr-xr-x 1 root wheel 38352 Nov 12 18:38 rmdir
    -r-xr-xr-x 1 root wheel 1244960 May 31 2008 sh
    -r-xr-xr-x 1 root wheel 38464 May 31 2008 sleep
    -r-xr-xr-x 1 root wheel 55744 May 31 2008 stty
    -r-xr-xr-x 1 root wheel 38128 Oct 27 21:19 sync
    -rwxr-xr-x 1 root wheel 610864 May 31 2008 tcsh
    -r-xr-xr-x 1 root wheel 46720 May 31 2008 test
    -r-xr-xr-x 1 root wheel 47648 Nov 12 18:38 unlink
    -rwxr-xr-x 1 root wheel 38544 Oct 16 00:51 wait4path
    -rwxr-xr-x 1 root wheel 982000 May 31 2008 zsh
    -rwxr-xr-x 1 root wheel 982000 May 31 2008 zsh-4.3.4


    mymacbook:bin bille$ file /bin/\[
    /bin/[: Mach-O universal binary with 2 architectures
    /bin/[ (for architecture i386): Mach-O executable i386
    /bin/[ (for architecture ppc7400): Mach-O executable ppc


    mymacbook:bin bille$ file /bin/test
    /bin/test: Mach-O universal binary with 2 architectures
    /bin/test (for architecture i386): Mach-O executable i386
    /bin/test (for architecture ppc7400): Mach-O executable ppc


    mymacbook:bin bille$ strings /bin/\[
    %s: %s
    %s: out of range
    %s: bad number
    argument expected
    closing paren expected
    missing ]
    unknown operand


    mymacbook:bin bille$ strings /bin/test
    %s: %s
    %s: out of range
    %s: bad number
    argument expected
    closing paren expected
    missing ]
    unknown operand
     
  2. LPZ macrumors 65816

    Joined:
    Jul 11, 2006
    #2
    I have them. I assume everyone does. Try

    man test

    (and you'll see what they are).
     
  3. ziggyonice macrumors 68020

    ziggyonice

    Joined:
    Mar 12, 2006
    Location:
    Rural America
    #3
    Don't touch anything in /bin. Or anything else that is invisible for that matter. You might break something. :)
     
  4. spikesnet thread starter macrumors newbie

    Joined:
    Mar 30, 2009
    #4
    "You might break something" is never a good reason to not touch something ;)
     
  5. old-wiz macrumors G3

    Joined:
    Mar 26, 2008
    Location:
    West Suburban Boston Ma
    #5
    the files in /bin are unix commands. mkdir = make directory, bash = bash shell. Hard to tell what 'test' is, but since it predates your install I'd leave it alone. You can remove anything you want, but you're responsible for dealing with anything that goes wrong afterwards.
     
  6. LPZ macrumors 65816

    Joined:
    Jul 11, 2006
    #6
    TEST(1) BSD General Commands Manual TEST(1)

    NAME
    test, [ -- condition evaluation utility

    SYNOPSIS
    test expression
    [ expression ]

    DESCRIPTION
    The test utility evaluates the expression and, if it evaluates to true,
    returns a zero (true) exit status; otherwise it returns 1 (false). If
    there is no expression, test also returns 1 (false).

    All operators and flags are separate arguments to the test utility.

    The following primaries are used to construct expressions:

    -b file True if file exists and is a block special file.

    -c file True if file exists and is a character special file.

    -d file True if file exists and is a directory.

    -e file True if file exists (regardless of type).
     

Share This Page