Shell Scripting
Part of the Linux course
You have worked out a sequence of six commands that does something useful: check a directory, make a folder, copy some files, print a summary. It works. Tomorrow you need it again, and you retype it from memory, and you get one argument wrong. A script is that sequence written down once, in a file, so the machine retypes it perfectly every time. There is no new language to learn here.
A script is a plain text file. There is no hello.sh in your lesson folder yet. Create it with this script: press Play on the block and the file is made for you. Pressing Play again does not make a second copy. ...
Want to learn Linux Shell Scripting in a real environment?
Click below, get a fresh Linux box with Linux ready to go, and work through Shell Scripting hands-on with an AI tutor that knows your code.
Start this lessonShell ScriptingWhat you'll learn
- Shebang
- Variables
- If
- For
- While
- Command substitution
- Exit codes
- Set -euo pipefail
Read this lesson in your language
All lessons in this course
17 lessons- 1The Shell and First Commands20 min
- 2Filesystem and Navigation25 min
- 3Files and Permissions30 min
- 4Text Tools: grep, sed, awk30 min
- 5Pipes and Redirection25 min
- 6Processes and Signals30 min
- 7Users and Groups25 min
- 8Package Management25 min
- 9Networking Basics30 min
- 10Shell Scripting35 min
- 11systemd Services35 min
- 12SSH and Remote Access30 min
- 13Logs and Journals25 min
- 14Disks and Storage30 min
- 15Cron and Scheduled Tasks25 min
- 16Performance and Monitoring30 min
- 17Capstone: Server Setup60 min
