# touch script.sh, open it and write something like:echo"hello, running script!"echo"where am i?"pwdecho"ok, let's go somewhere else!"cd /code
pwdecho"that's better"
To execute a script:
./script.sh
### oh no, permission denied! what now?
Permissions
# see permissionsls -l
# they are repeated, 3 times, for user (owner of the file), group of users, everyone else.# -rwx - read, write, execute# to change permissionschmod u+x ./script.sh
Alias
aliasscript='~/script.sh'# is this an alias?type script
Getting help and Man pages
node --help # -- is how you indicate a flag, -h is a shorthand, so node -h is the same.
For linux's own utilities, --help wouldn't work, so they have man manual command.
grep'echo' ./script.sh
grep'<body>' ./
# grep: ./: Is a directory error, so you need to add recursive flag to search through directoriesgrep -r '<body>' ./