Bash is the command line shell that you encounter when you open the terminal on most Unix operating systems, like MacOS and Linux. Learn how to create your own bash scripts to automate tasks on your computer.

#linux #compsci #100SecondsOfCode

🔗 Resources

Bash Reference https://www.gnu.org/software/bash/manual/bash.html
Unix Shell History https://developer.ibm.com/tutorials/l-linux-shells/
Linux File System Explained https://youtu.be/42iQKuQodW4

🔥 Watch more with Fireship PRO

Upgrade to Fireship PRO at https://fireship.io/pro
Use code lORhwXd2 for 25% off your first payment. 

🎨 My Editor Settings

- Atom One Dark 
- vscode-icons
- Fira Code Font

📖 Topics Covered 

- Bash Programming Tutorial
- Linux Command Line Basics
- Bash Scripting
- History of Unix Shells
- Learn to Code with Bash
2024-02-04T05:46:52.105Z
nova-2
2-general-nova
2024-01-09.29447
30089e05-99d1-4376-b32e-c263170674af
9a74214a-4244-4884-a2c6-7a579a22b939
584a605a582dcb6379971e9d5241d7f785ea99de55fe092f35dfd7ef94df7cd6
67875a7f-c9c4-48a0-aa55-5bdb8a91c34a
deprecated
Bash, a command language interpreter for interacting with a computer from the command line.
It's also called a shell, because it surrounds the operating system kernel to hide its intricate details, while allowing you, the programmer, to do important stuff like access data and write files by typing simple commands.
This was a revolutionary concept when it was developed in the early seventies, and back when programmers were still using punch cards.
The shell concept evolved over the years, with the born shell being the most popular version.
That is, until 1989 when the Born Again Shell or Bash came about.
When you open up the terminal on a Unix machine, like macOS and most Linux distros.
The default shell is usually bash.
It provides a prompt where you can type a command, which will then be interpreted by the shell and executed on the operating system.
To find out if you're running bash, type in which dollar sign shell from the command line.
It's like any other application that lives in the binaries directory, free, but bash is also a programming language that allows us to write scripts, which means anything we type manually into the command line can be automated with code.
When you first launch the shell, it actually runs a startup script that's defined in the bash profile or bashrc file on your system.
This allows you to customize the behavior and appearance of the shell whenever you start a new session.
You can add your own custom bash scripts to any project by creating a file that ends in dot s h or no file extension at all.
The first line in that file should always be a shebang followed by the path to the application should run it.
Below that, we can start writing commands like echo to print something and they'll be interpreted line by line.
To create a variable, type a name in all caps followed by the equal sign, then reference it later in the script using a dollar sign in front of the name.
Now to execute the script, simply typed the file name into the shell.
That was easy, but what if we want to pass in some arguments when we run the script?
Positional arguments will automatically be assigned variable names of 1, 2, 3, and so on.
Now in other cases, you may need additional user input in the middle of a script.
You can create loops in bash like a do while loop here that will prompt the user to continue the script on a yes answer or exit on a no answer.
From there, we can implement conditional logic with an if statement, which will test if the value on the upside is less than the value on the right side.
If true, then run this command.
Otherwise, run the else command.
Another cool feature is that if you have multiple long running processes, says you can run them in parallel in the background by adding an ampersand after the command.
This has been bash, the born again shell in 100 seconds.
If you wanna see more short videos like this, make sure to hit the like button and subscribe.
Thanks for watching and I will see you in the next one.

Speaker 0: Bash, a command language interpreter for interacting with a computer from the command line. It's also called a shell, because it surrounds the operating system kernel to hide its intricate details, while allowing you, the programmer, to do important stuff like access data and write files by typing simple commands. This was a revolutionary concept when it was developed in the early seventies, and back when programmers were still using punch cards. The shell concept evolved over the years, with the born shell being the most popular version. That is, until 1989 when the Born Again Shell or Bash came about.

When you open up the terminal on a Unix machine, like macOS and most Linux distros. The default shell is usually bash. It provides a prompt where you can type a command, which will then be interpreted by the shell and executed on the operating system. To find out if you're running bash, type in which dollar sign shell from the command line. It's like any other application that lives in the binaries directory, free, but bash is also a programming language that allows us to write scripts, which means anything we type manually into the command line can be automated with code.

When you first launch the shell, it actually runs a startup script that's defined in the bash profile or bashrc file on your system. This allows you to customize the behavior and appearance of the shell whenever you start a new session. You can add your own custom bash scripts to any project by creating a file that ends in dot s h or no file extension at all. The first line in that file should always be a shebang followed by the path to the application should run it. Below that, we can start writing commands like echo to print something and they'll be interpreted line by line.

To create a variable, type a name in all caps followed by the equal sign, then reference it later in the script using a dollar sign in front of the name. Now to execute the script, simply typed the file name into the shell. That was easy, but what if we want to pass in some arguments when we run the script? Positional arguments will automatically be assigned variable names of 1, 2, 3, and so on. Now in other cases, you may need additional user input in the middle of a script.

You can create loops in bash like a do while loop here that will prompt the user to continue the script on a yes answer or exit on a no answer. From there, we can implement conditional logic with an if statement, which will test if the value on the upside is less than the value on the right side. If true, then run this command. Otherwise, run the else command. Another cool feature is that if you have multiple long running processes, says you can run them in parallel in the background by adding an ampersand after the command.

This has been bash, the born again shell in 100 seconds. If you wanna see more short videos like this, make sure to hit the like button and subscribe. Thanks for watching and I will see you in the next one.
Bash, a command language interpreter for interacting with a computer from the command line. It's also called a shell, because it surrounds the operating system kernel to hide its intricate details, while allowing you, the programmer, to do important stuff like access data and write files by typing simple commands. This was a revolutionary concept when it was developed in the early seventies, and back when programmers were still using punch cards. The shell concept evolved over the years, with the born shell being the most popular version. That is, until 1989 when the Born Again Shell or Bash came about. When you open up the terminal on a Unix machine, like macOS and most Linux distros. The default shell is usually bash. It provides a prompt where you can type a command, which will then be interpreted by the shell and executed on the operating system. To find out if you're running bash, type in which dollar sign shell from the command line. It's like any other application that lives in the binaries directory, free, but bash is also a programming language that allows us to write scripts, which means anything we type manually into the command line can be automated with code. When you first launch the shell, it actually runs a startup script that's defined in the bash profile or bashrc file on your system. This allows you to customize the behavior and appearance of the shell whenever you start a new session. You can add your own custom bash scripts to any project by creating a file that ends in dot s h or no file extension at all.
The first line in that file should always be a shebang followed by the path to the application should run it. Below that, we can start writing commands like echo to print something and they'll be interpreted line by line. To create a variable, type a name in all caps followed by the equal sign, then reference it later in the script using a dollar sign in front of the name.
programming
Now to execute the script, simply typed the file name into the shell. That was easy, but what if we want to pass in some arguments when we run the script? Positional arguments will automatically be assigned variable names of 1, 2, 3, and so on. Now in other cases, you may need additional user input in the middle of a script.
You can create loops in bash like a do while loop here that will prompt the user to continue the script on a yes answer or exit on a no answer. From there, we can implement conditional logic with an if statement, which will test if the value on the upside is less than the value on the right side. If true, then run this command. Otherwise, run the else command. Another cool feature is that if you have multiple long running processes, says you can run them in parallel in the background by adding an ampersand after the command.
logic
logical reasoning
This has been bash, the born again shell in 100 seconds. If you wanna see more short videos like this, make sure to hit the like button and subscribe. Thanks for watching and I will see you in the next one.
Bash, a command language interpreter for interacting with a computer from the command line. It's also called a shell, because it surrounds the operating system kernel to hide its intricate details, while allowing you, the programmer, to do important stuff like access data and write files by typing simple commands. This was a revolutionary concept when it was developed in the early seventies, and back when programmers were still using punch cards. The shell concept evolved over the years, with the born shell being the most popular version. That is, until 1989 when the Born Again Shell or Bash came about. When you open up the terminal on a Unix machine, like macOS and most Linux distros. The default shell is usually bash. It provides a prompt where you can type a command, which will then be interpreted by the shell and executed on the operating system. To find out if you're running bash, type in which dollar sign shell from the command line. It's like any other application that lives in the binaries directory, free, but bash is also a programming language that allows us to write scripts, which means anything we type manually into the command line can be automated with code. When you first launch the shell, it actually runs a startup script that's defined in the bash profile or bashrc file on your system. This allows you to customize the behavior and appearance of the shell whenever you start a new session. You can add your own custom bash scripts to any project by creating a file that ends in dot s h or no file extension at all. The first line in that file should always be a shebang followed by the path to the application should run it. Below that, we can start writing commands like echo to print something and they'll be interpreted line by line. To create a variable, type a name in all caps followed by the equal sign, then reference it later in the script using a dollar sign in front of the name. Now to execute the script, simply typed the file name into the shell. That was easy, but what if we want to pass in some arguments when we run the script? Positional arguments will automatically be assigned variable names of 1, 2, 3, and so on. Now in other cases, you may need additional user input in the middle of a script. You can create loops in bash like a do while loop here that will prompt the user to continue the script on a yes answer or exit on a no answer. From there, we can implement conditional logic with an if statement, which will test if the value on the upside is less than the value on the right side. If true, then run this command. Otherwise, run the else command. Another cool feature is that if you have multiple long running processes, says you can run them in parallel in the background by adding an ampersand after the command. This has been bash, the born again shell in 100 seconds. If you wanna see more short videos like this, make sure to hit the like button and subscribe. Thanks for watching and I will see you in the next one.
Bash,
bash
a
a
command
command
language
language
interpreter
interpreter
for
for
interacting
interacting
with
with
a
a
computer
computer
from
from
the
the
command
command
line.
line
It's
it's
also
also
called
called
a
a
shell,
shell
because
because
it
it
surrounds
surrounds
the
the
operating
operating
system
system
kernel
kernel
to
to
hide
hide
its
its
intricate
intricate
details,
details
while
while
allowing
allowing
you,
you
the
the
programmer,
programmer
to
to
do
do
important
important
stuff
stuff
like
like
access
access
data
data
and
and
write
write
files
files
by
by
typing
typing
simple
simple
commands.
commands
This
this
was
was
a
a
revolutionary
revolutionary
concept
concept
when
when
it
it
was
was
developed
developed
in
in
the
the
early
early
seventies,
seventies
and
and
back
back
when
when
programmers
programmers
were
were
still
still
using
using
punch
punch
cards.
cards
The
the
shell
shell
concept
concept
evolved
evolved
over
over
the
the
years,
years
with
with
the
the
born
born
shell
shell
being
being
the
the
most
most
popular
popular
version.
version
That
that
is,
is
until
until
1989
1989
when
when
the
the
Born
born
Again
again
Shell
shell
or
or
Bash
bash
came
came
about.
about
When
when
you
you
open
open
up
up
the
the
terminal
terminal
on
on
a
a
Unix
unix
machine,
machine
like
like
macOS
macos
and
and
most
most
Linux
linux
distros.
distros
The
the
default
default
shell
shell
is
is
usually
usually
bash.
bash
It
it
provides
provides
a
a
prompt
prompt
where
where
you
you
can
can
type
type
a
a
command,
command
which
which
will
will
then
then
be
be
interpreted
interpreted
by
by
the
the
shell
shell
and
and
executed
executed
on
on
the
the
operating
operating
system.
system
To
to
find
find
out
out
if
if
you're
you're
running
running
bash,
bash
type
type
in
in
which
which
dollar
dollar
sign
sign
shell
shell
from
from
the
the
command
command
line.
line
It's
it's
like
like
any
any
other
other
application
application
that
that
lives
lives
in
in
the
the
binaries
binaries
directory,
directory
free,
free
but
but
bash
bash
is
is
also
also
a
a
programming
programming
language
language
that
that
allows
allows
us
us
to
to
write
write
scripts,
scripts
which
which
means
means
anything
anything
we
we
type
type
manually
manually
into
into
the
the
command
command
line
line
can
can
be
be
automated
automated
with
with
code.
code
When
when
you
you
first
first
launch
launch
the
the
shell,
shell
it
it
actually
actually
runs
runs
a
a
startup
startup
script
script
that's
that's
defined
defined
in
in
the
the
bash
bash
profile
profile
or
or
bashrc
bashrc
file
file
on
on
your
your
system.
system
This
this
allows
allows
you
you
to
to
customize
customize
the
the
behavior
behavior
and
and
appearance
appearance
of
of
the
the
shell
shell
whenever
whenever
you
you
start
start
a
a
new
new
session.
session
You
you
can
can
add
add
your
your
own
own
custom
custom
bash
bash
scripts
scripts
to
to
any
any
project
project
by
by
creating
creating
a
a
file
file
that
that
ends
ends
in
in
dot
dot
s
s
h
h
or
or
no
no
file
file
extension
extension
at
at
all.
all
The
the
first
first
line
line
in
in
that
that
file
file
should
should
always
always
be
be
a
a
shebang
shebang
followed
followed
by
by
the
the
path
path
to
to
the
the
application
application
should
should
run
run
it.
it
Below
below
that,
that
we
we
can
can
start
start
writing
writing
commands
commands
like
like
echo
echo
to
to
print
print
something
something
and
and
they'll
they'll
be
be
interpreted
interpreted
line
line
by
by
line.
line
To
to
create
create
a
a
variable,
variable
type
type
a
a
name
name
in
in
all
all
caps
caps
followed
followed
by
by
the
the
equal
equal
sign,
sign
then
then
reference
reference
it
it
later
later
in
in
the
the
script
script
using
using
a
a
dollar
dollar
sign
sign
in
in
front
front
of
of
the
the
name.
name
Now
now
to
to
execute
execute
the
the
script,
script
simply
simply
typed
typed
the
the
file
file
name
name
into
into
the
the
shell.
shell
That
that
was
was
easy,
easy
but
but
what
what
if
if
we
we
want
want
to
to
pass
pass
in
in
some
some
arguments
arguments
when
when
we
we
run
run
the
the
script?
script
Positional
positional
arguments
arguments
will
will
automatically
automatically
be
be
assigned
assigned
variable
variable
names
names
of
of
1,
1
2,
2
3,
3
and
and
so
so
on.
on
Now
now
in
in
other
other
cases,
cases
you
you
may
may
need
need
additional
additional
user
user
input
input
in
in
the
the
middle
middle
of
of
a
a
script.
script
You
you
can
can
create
create
loops
loops
in
in
bash
bash
like
like
a
a
do
do
while
while
loop
loop
here
here
that
that
will
will
prompt
prompt
the
the
user
user
to
to
continue
continue
the
the
script
script
on
on
a
a
yes
yes
answer
answer
or
or
exit
exit
on
on
a
a
no
no
answer.
answer
From
from
there,
there
we
we
can
can
implement
implement
conditional
conditional
logic
logic
with
with
an
an
if
if
statement,
statement
which
which
will
will
test
test
if
if
the
the
value
value
on
on
the
the
upside
upside
is
is
less
less
than
than
the
the
value
value
on
on
the
the
right
right
side.
side
If
if
true,
true
then
then
run
run
this
this
command.
command
Otherwise,
otherwise
run
run
the
the
else
else
command.
command
Another
another
cool
cool
feature
feature
is
is
that
that
if
if
you
you
have
have
multiple
multiple
long
long
running
running
processes,
processes
says
says
you
you
can
can
run
run
them
them
in
in
parallel
parallel
in
in
the
the
background
background
by
by
adding
adding
an
an
ampersand
ampersand
after
after
the
the
command.
command
This
this
has
has
been
been
bash,
bash
the
the
born
born
again
again
shell
shell
in
in
100
100
seconds.
seconds
If
if
you
you
wanna
wanna
see
see
more
more
short
short
videos
videos
like
like
this,
this
make
make
sure
sure
to
to
hit
hit
the
the
like
like
button
button
and
and
subscribe.
subscribe
Thanks
thanks
for
for
watching
watching
and
and
I
i
will
will
see
see
you
you
in
in
the
the
next
next
one.
one
success
The speaker explains the shell and command language interpreter, which allow developers to access and write files by typing simple commands. The shell concept evolved in the early 70ties, with the default shell being bash and the ability to customize behavior with code. The speaker also explains the use of conditional logic and the use of ampersand in command lines.
Bash in 100 Seconds
Bash, a command language interpreter for interacting with a computer from the command line. It's also called a shell, because it surrounds the operating system kernel to hide its intricate details, while allowing you, the programmer, to do important stuff like access data and write files by typing simple commands. This was a revolutionary concept when it was developed in the early seventies, and back when programmers were still using punch cards. The shell concept evolved over the years, with the born shell being the most popular version. That is, until 1989 when the Born Again Shell or Bash came about. When you open up the terminal on a Unix machine, like macOS and most Linux distros. The default shell is usually bash. It provides a prompt where you can type a command, which will then be interpreted by the shell and executed on the operating system. To find out if you're running bash, type in which dollar sign shell from the command line. It's like any other application that lives in the binaries directory, free, but bash is also a programming language that allows us to write scripts, which means anything we type manually into the command line can be automated with code. When you first launch the shell, it actually runs a startup script that's defined in the bash profile or bashrc file on your system. This allows you to customize the behavior and appearance of the shell whenever you start a new session. You can add your own custom bash scripts to any project by creating a file that ends in dot s h or no file extension at all. The first line in that file should always be a shebang followed by the path to the application should run it. Below that, we can start writing commands like echo to print something and they'll be interpreted line by line. To create a variable, type a name in all caps followed by the equal sign, then reference it later in the script using a dollar sign in front of the name. Now to execute the script, simply typed the file name into the shell. That was easy, but what if we want to pass in some arguments when we run the script? Positional arguments will automatically be assigned variable names of 1, 2, 3, and so on. Now in other cases, you may need additional user input in the middle of a script. You can create loops in bash like a do while loop here that will prompt the user to continue the script on a yes answer or exit on a no answer. From there, we can implement conditional logic with an if statement, which will test if the value on the upside is less than the value on the right side. If true, then run this command. Otherwise, run the else command. Another cool feature is that if you have multiple long running processes, says you can run them in parallel in the background by adding an ampersand after the command. This has been bash, the born again shell in 100 seconds. If you wanna see more short videos like this, make sure to hit the like button and subscribe. Thanks for watching and I will see you in the next one.
The speaker explains the shell and command language interpreter, which allow developers to access and write files by typing simple commands. The shell concept evolved in the early 70ties, with the default shell being bash and the ability to customize behavior with code. The speaker also explains the use of conditional logic and the use of ampersand in command lines.