How do I make a Linux or FreeBSD file an executable file?
You need to use chmod command which is use to change file access permissions as well as to setup an executable permission on file.
General syntax:
chmod +x file-name
For example to setup executable permission on a file called foo.sh (shell script):
$ chmod +x foo.sh
To execute file:
$ ./foo.sh
To setup executable permission on a binary file called bar:
$ chmod +x bar
To execute binary file:
$ ./bar
See also:
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Howto Compiling C program and creating executable file under Linux / UNIX / *BSD
- FreeBSD make: don't know how to make buildkernel. Stop Error and Solution
- Reconfiguring FreeBSD Ports - Remove OPTIONS config For Any Port
- How do I install and search FreeBSD ports or a package?
- Howto see output of C program in Linux or UNIX
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!


Recent Comments
Today ~ 1 Comment
Today ~ 2 Comments
Yesterday ~ 9 Comments
Yesterday ~ 32 Comments
07/04/2008 07:04 pm (2 days ago) ~ 1 Comment