Change a Plain text file to Unix Executable File

Discussion in 'Mac OS X System & Mac Software' started by jamiesalisbury, Mar 29, 2011.

  1. jamiesalisbury

    jamiesalisbury
    uix_expand uix_collapse
    Registered

    Joined:
    Jun 12, 2008
    Messages:
    5
    Likes Received:
    0
    I have a file that should be a Unix Executable File, that for some reason shows up as a Plain Text file.

    I have downloaded FileType - but I don't know the creator and type codes that I need. If anyone knows these I'd be very grateful.

    I've read it's possible to change this in Terminal as well - but I've never used Terminal, so I will need a step by step walkthrough if that is the solution.

    Thanks

    Jamie

    OSX 10.5.8
     
  2. ElDiabloConCaca

    ElDiabloConCaca
    uix_expand uix_collapse
    U.S.D.A. Prime

    Joined:
    Aug 22, 2001
    Messages:
    14,533
    Likes Received:
    18
    Open Terminal.

    type:
    Code:
    chmod +x 
    ...with a space at the end (and do NOT press enter yet).

    Then, drag the file you want to change from the Finder and drop it on top of the Terminal window. The file path and filename should automatically fill in (and you should ensure that there's a space between "+x" and the file path).

    Press enter.
     
    WhatTheFrak likes this.
  3. jamiesalisbury

    jamiesalisbury
    uix_expand uix_collapse
    Registered

    Joined:
    Jun 12, 2008
    Messages:
    5
    Likes Received:
    0
    You're a legend, thank you!!!
     
  4. WhatTheFrak

    WhatTheFrak
    uix_expand uix_collapse
    Registered

    Joined:
    Aug 6, 2011
    Messages:
    1
    Likes Received:
    0
    Worked for me, too. Thanks, Diablo!

    Great name, BTW. ¬°Excelente!
     
  5. sunando_999

    sunando_999
    uix_expand uix_collapse
    Registered

    Joined:
    Feb 24, 2016
    Messages:
    2
    Likes Received:
    0
    Hi ElDiabloConCaca! Can you tell me where do I get the Unix Executable File after the conversion? Is it supposed to be in the same directory where the .txt file is present?
     
  6. Whitehill

    Whitehill
    uix_expand uix_collapse
    Registered

    Joined:
    May 10, 2005
    Messages:
    657
    Likes Received:
    5
    It's the same file you started with. It just now has the magic attribute that makes it executable.
     
  7. sunando_999

    sunando_999
    uix_expand uix_collapse
    Registered

    Joined:
    Feb 24, 2016
    Messages:
    2
    Likes Received:
    0
  8. Whitehill

    Whitehill
    uix_expand uix_collapse
    Registered

    Joined:
    May 10, 2005
    Messages:
    657
    Likes Received:
    5
    sunando_999, I watched the video. It does not create a new file, just modifies the attributes of the original. With the executable attribute switched on, your Mac's Finder displays the icon differently. If you now issue
    chmod -x /path/to/your/file​
    its icon will display as before.
     

Share This Page