From the course: Linux Tips
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
System basics: Bash scripting basics - Linux Tutorial
From the course: Linux Tips
System basics: Bash scripting basics
- [Scott] The Bash shell is a useful interactive terminal. But you can also put together Bash commands and operators into scripts that can be run as programs. These collections of commands, when they're put together, are called Bash scripts. Bash scripts can be really helpful for packaging a lot of different commands all together to reduce errors in a procedure that you have to do over and over. You can also set them up to take particular input in order to do a procedure that might have some variation to it. A Bash script starts out a line called shebang. It's a special directive that tells the shell where to find the program that's going to run the rest of the script. The shebang starts with a pound or hash sign and an exclamation mark, and then the path to the interpreter, in this case, usr/bin/env and bash. I'll create a script with a text editor. I'll write nano myscript.sh. And first thing, I'll put in the shebang, pound sign exclamation mark, usr/bin/env bash. Then, on the next…
Contents
-
-
-
-
System basics: The Linux file system6m 35s
-
(Locked)
System basics: The command line5m 23s
-
(Locked)
System basics: Keyboard shortcuts1m 40s
-
(Locked)
System basics: sudo access and root4m 57s
-
(Locked)
System basics: Explore a system4m 38s
-
(Locked)
System basics: Exploring Bash7m
-
(Locked)
System basics: Bash scripting basics4m 59s
-
(Locked)
System basics: The Bash prompt6m 2s
-
(Locked)
System basics: Bash output redirection4m 57s
-
(Locked)
Bash expansions and substitutions4m 23s
-
Bash aliases and functions4m 7s
-
(Locked)
Bash operators6m 55s
-
Logs5m 4s
-
(Locked)
Grub3m 19s
-
(Locked)
SysV init4m 43s
-
(Locked)
Systemd5m 29s
-
(Locked)
Cron8m 7s
-
(Locked)
Understanding chroot3m 16s
-
(Locked)
System basics: User and group management8m 39s
-
(Locked)
System basics: Service management3m 44s
-
(Locked)
Backing up data with rsync5m 35s
-
(Locked)
Splitting and combining files3m 3s
-
(Locked)
Environment configuration files2m 43s
-
(Locked)
Working with dotfiles1m 43s
-
(Locked)
Exploring the PATH variable3m 51s
-
(Locked)
Browsing with the directory stack3m 19s
-
(Locked)
Finding or locating files3m 52s
-
(Locked)
Working with swap4m 29s
-
(Locked)
Read and write caches3m 5s
-
(Locked)
Terminals, consoles, and TTYs4m 27s
-
(Locked)
Exploring journalctl5m 2s
-
-
-
-
-
-
-
-
-
-
-
-