Intro Flashcards

1
Q

why one should write bash scripts

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

do we have if else, loops, variables in basg

A

yes we do have ths things in bash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

is bash an software or programming language

A

it is not wrong to think that bash is an programming language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

is bash interpreter or shell

A

bash is both interpreter and shell as well

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is an interpreter in linux, as shell or as bash

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what you need to follow along this course

A

computer
terminal

linux server or linux installation

spin up linux virtual machine or maybe a server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is bash

A

its a shell or a terminal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what does shell do

A

shell allows to interact with system through commands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what does mean by automation

A

as a administrator we have to execute lot of commands, but we dont want to do that

so we automate tasks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

why people use command lines to this date also

A

command line are vrey powerfull we can manage servers through commands only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what are different shells available on linux

A
  1. zsh
  2. 3.
    4.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

which is the default shell on linux systems now a days

A

bash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

how to find which shell we are using

A

echo $SHELL

  • this will tell us what shell we are using
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

if we are not using bash then what to do

A

$ which bash
/usr/bin/bash

enter the following command then you are good to use bash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is bash script

A

script is text file, where one or more command are written / listed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

how to turn command into a script

A

create bash file with .sh extenstion
write command into it, like ls
execute the file

17
Q

how to properly write bash script

A

!/bin/bash => shee bang, first line

18
Q

part 3 | what are variables used for

A

to store information

19
Q

create myName variable and store value into it

A

$ myName = “swapnil”

20
Q

print this variable to terminal

A

$ echo $myName

21
Q

what does exit do

A

close entire window

22
Q

what is importance of session or window

A

when we close window, the variables previously are gone

23
Q

write variables in bash script

A

myname = “nil”
myage = “22”

echo “hello, my name is $myname”
echo “I’m $myage years old”

24
Q

can we use single quote for string

A

no we cant use single quotes for string

25
Q

what will happen if we use single quote and reference variable inside the string

A

output will be the name of variable itself…

26
Q

why we use variables

A

using variables help us to avoid retyping

example:

word = “awesome”

echo “linux is $word”
echo “I’m $word”

27
Q
A
28
Q
A
29
Q
A
30
Q
A
31
Q
A