0

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?

NKAT
  • 19
  • 4
  • 2
    Try and post the output of `ls -l` in the directory. There you can see the permission string, which need to have the `x` (executable) bit. If the file is executable it is colored green by default. – Artur Meinild May 28 '21 at 11:00
  • 1
    See [What do the different colors mean in ls?](https://askubuntu.com/questions/17299/what-do-the-different-colors-mean-in-ls) – steeldriver May 28 '21 at 11:04

1 Answers1

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
  • 69,223
  • 56
  • 216
  • 327