Running Scripts
Save commands in a file, start it with a shebang line such as #!/bin/bash, make it executable with chmod +x and run it with ./script.sh. You can also run bash script.sh.
Example
#!/bin/bash
echo "Hello from a script"
# Terminal:
# chmod +x hello.sh
# ./hello.shExercise
Make a file executable.
chmod hello.sh
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.