How do I make a Linux or FreeBSD file an executable file?

by on March 30, 2006 · 0 comments· last updated at March 30, 2006

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:



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as:

Previous Faq:

Next Faq: