🖥Scripting
The basics of shell script programming
$ echo '#!/bin/sh' > my-script.sh # Creat and write in file
$ echo 'echo Hello World' >> my-script.sh # update file contcont
$ chmod 755 my-script.sh # Set file Permission
$ ./my-script.sh
Hello World
$
# File permission
# 4 stands for "read",
# 2 stands for "write",
# 1 stands for "execute", and
# 0 stands for "no permission."
# 7 = 4 + 2 + 1 --> rwx
# 5 = 4 + 1 --> r-x
# owner-group-others
# 10 character permission
# first character is object type
# a hyphen represents a plain file
# d -> directory file
# l -> symlink file
# s -> socket file
# p -> pipe (FIFO, Read and Write)
# 2-4 character is owner perminssion
# 5-7 character is group permission
# 8-10 character is other permission
# permission are
# r->Read, w->write, x-> excute, s->Stiky bit)
Chmod Terminology
Note:
Last updated