# issamhammi at issams-air.home in ~ [18:09:27]
→ bash --version
GNU bash, version 5.0.18(1)-release (x86_64-apple-darwin19.5.0)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
Bourne Again SHell or commonly called Bash is a command language interpreter
A Shell is a program taking commands from the keyboard ans passing them to the operating system to be executed. Today shells are accessible through terminals
A script allows a set of commands to be executed one after the other
| path | |
|---|---|
| /bin | where I can find my binaries (ls, cat...) |
| /sbin | system administrator binaries (used by root) |
| /boot | where lives your OS (do not touch) |
| /etc | etcetera - system config files |
| /dev | special folder dedicated to hardware |
| /lib | libraries required by the binaries to run |
| /sys | kernel system files (do not touch) |
| /var | files expecting to grow in files (logs) |
| /root | root user dedicated folder |
| /usr | installed user applications |
| /home | user files |
Variables accessible outside of your program.
$SHELL
$HOME
$PATH
...
When a login shell is started, it reads and execute commands from this file.
chmod u=rwx,g=rx,o=r myfilechmod 754 myfilechmod +x myfile| Number | Permission | rwx (display in terminal) |
|---|---|---|
| 0 | none | --- |
| 1 | execute | --x |
| 2 | write only | -w- |
| 3 | write and execute | -wx |
| 4 | read only | r-- |
| 5 | read and execute | r-x |
| 6 | read and write | rw- |
| 7 | read, write and execute | rwx |