# Change a Plain text file to Unix Executable File



## jamiesalisbury (Mar 29, 2011)

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


----------



## ElDiabloConCaca (Mar 29, 2011)

Open Terminal.

type:

```
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.


----------



## jamiesalisbury (Mar 30, 2011)

You're a legend, thank you!!!


----------



## WhatTheFrak (Aug 6, 2011)

Worked for me, too.  Thanks, Diablo!

Great name, BTW.  ¡Excelente!


----------



## sunando_999 (Feb 24, 2016)

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?


----------



## Whitehill (Feb 24, 2016)

It's the same file you started with.  It just now has the magic attribute that makes it executable.


----------



## sunando_999 (Feb 25, 2016)

Thanks Whitehill. https://www.youtube.com/watch?v=5v4AF8wStSo shows that a new Unix Executable File is created. How is that? It's not supposed to happen since we're using *chmod*, right?


----------



## Whitehill (Feb 25, 2016)

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.


----------

