On Ubuntu 20.04 there's a directory with a bunch of .sh files in it. Except one all are in green. Would someone please tell how that can be and what makes that particular .sh file so special?
Asked
Active
Viewed 2,815 times
1 Answers
2
It is because that file has no execute permission. The ls
program shows the names of executable files in green. Try listing with ls -l
- the permissions will be listed to the left of the filenames. r
means read, w
means write, and x
means execute. There are three sets of permissions - a set for the owner of the file, a set for the group associated with the file (ls -l
also lists these), and a set for "others" which is any user or program. To make the file executable for the owner, you can run chmod u+x
, for example.

Zanna
- 70,465

Sagar Shinde
- 21
ls -l
in the directory. There you can see the permission string, which need to have thex
(executable) bit. If the file is executable it is colored green by default. – Artur Meinild May 28 '21 at 11:00