User Tools

Site Tools


Make a file Executable


Unlike Windows, Linux does not have files that are executable, all files can have this attribute. So for example, I have a python file that is just a text file, and I will to be able to run this from the command line, If I look at the file using ls -al:

  ls -al

I will see something like this:

  "-rw-r--r-- 1 pi pi 4452 Jul 25 17:46"

The permissions for this file are:


This file has three sets of permissions:

  User -rw  |  Group -r-  |  Others r--
  where r is read - w is write - x is execute

I will cover permissions in another section, to give this file 'everything' use the following:

  chmod 777

If we look at the permissions now by using:

  ls -al

We will see:


Now we can execute this file (assuming it contains something valid that is executable)


The file will now be executed.

make_a_file_executable.txt · Last modified: 2017/02/28 18:00 (external edit)