Fox Chapter 9 & 16

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 97

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

98 Terms

1
Shell
An interpreted environment where commands are entered and executed line by line.
New cards
2
Interpreted program
A program that is translated and executed line by line.
New cards
3
Compiled program
A program that is translated entirely before execution.
New cards
4
Bourne Shell
One of the earliest Unix shells created in 1977.
New cards
5
Bash
A shell that includes features from the Bourne shell and simplifies syntax for user-friendliness.
New cards
6
History list
A record of commands entered in the current Bash session.
New cards
7
Control+p
Command to retrieve the previous instruction from the history list.
New cards
8
Control+n
Command to display the next command from the history list.
New cards
9
Tab completion
A feature that completes directory or filename inputs automatically.
New cards
10
Alias
A shortcut command that represents a longer command in the shell.
New cards
11

Tilde expansion ~

A shorthand for referencing the user's home directory in commands.
New cards
12

Brace expansion {}

Used to create a series of items or commands by enclosing them in braces.
New cards
13
Wildcard

Can act as anything , * “match anything”

New cards
14
Environment variable
A variable defined by the operating system or applications, capitalized.
New cards
15
User variable
A variable defined by the user and used for command-line operations.
New cards
16
echo command

A command that prints text or variable values to the terminal. You can also view the contents of a variable using this command.

New cards
17
Redirection
The process of changing the standard input/output of commands.
New cards
18
Pipe
A method to redirect the output of one command as input to another.
New cards
19
Manual pages
Documentation for commands accessed using the 'man' command.
New cards
20
Text editor
A program used to edit plain text files, e.g., vi and emacs.
New cards
21
Conditional statement
A statement that executes based on whether a specified condition is true.
New cards
22
Iteration
The repetition of a process in programming, exemplified by loops.
New cards
23
While loop
A loop that executes while a given condition remains true.
New cards
24
If-then statement
A control structure that executes actions based on a condition.
New cards
25
Parameter
A value passed to the script or function for processing.
New cards
26
Script
An interpreted program that can accept parameters and has executable code.
New cards
27
Arithmetic operation
Basic math operations performed with numerical inputs in scripts.
New cards
28
exit status
A numerical representation of a command's success or failure, typically `0` for success.
New cards
29

What does typing !number where number is the number of the entry in the history list do?

Recalls an instruction from the history list

New cards
30

control+f

move cursor forward one character

New cards
31

control+b

move cursor backward one character

New cards
32

Escape key+f

move cursor forward one word

New cards
33

escape key+b

move cursor backward one word

New cards
34

control+a

move cursor to the beginning of the line

New cards
35

control+e

move cursor to the end of the line

New cards
36

control+d

delete the character where the cursor is at

New cards
37

control+k

 kill(delete) the contents from the cursor to the end of the line

New cards
38

control+w

delete all the characters before the cursor to the beginning of the word

New cards
39

control+y

take whatever was recently deleted and yank it back put it in current cursor position

New cards
40

control+_

undo the last editing operation (delete or paste) 

New cards
41

(T/F) Bash will treat any number as a string unless you specify that it should be a number

True

New cards
42

How do we change a number to a number and not a string in bash?

Enclose in parantheses

New cards
43

How would we obtain a value stored in a variable?

Add $ before variable name

New cards
44

How would we reference the command date ?

` date `

New cards
45

What does the PATH variable store

 a list of directories, whenever you enter a Linux command or file name, if the item is not found in the current working directory, then the Linux interpreter checks for the item in every directory

New cards
46

How to add to your PATH variable?

PATH=$PATH:/home/nameofdirectory

New cards
47

< redirection

redirect the input to come from an input file

New cards
48

> redirection

redirect the output to go to an output file, overwriting the file if it already exists.

New cards
49

>> redirection

redirect the output to be appended to an already existing file, or create the file if it does not exist

New cards
50

<< redirection

redirect the input to come from keyboard where input will terminate with a special keyword that you specify after

New cards
51

| redirection

redirect the output of one command to be the input of another

New cards
52

Most common form of help; use this command for knowing about an instruction

man command

New cards
53

How does the find command differ from the man command?

Includes list of examples

New cards
54

Apropos

allows us to search for a command based on what it accomplishes/does.

New cards
55

3 common text editors

  • GUI editor : Text Editor

  • vi

  • emacs

New cards
56

3 different modes of vi

command mode, insert mode and replace mode.

New cards
57

Command mode

 is the default mode in vi so keystrokes are interpreted as commands, a command preceded by a number means that command is performed that many times

New cards
58

Insert Mode

 is the mode in vi similar to a word processor, with each keypress the cursor advances to the next position. The only keystroke command in this mode is the escape key, which exits the mode returning you to command mode. 

New cards
59

Replace mode

mode in vi that as you enter keystrokes the characters overwrite the characters already present. 

New cards
60

o (vi text editor mode command)

insert a blank line after the current line and enter insert mode

New cards
61

O (vi text editor mode command)

insert a blank line before the current line and enter insert mode

New cards
62

I (vi text editor mode command)

Enter insert mode at the beginning of current line

New cards
63

A (vi text editor mode command)

Enter insert mode at the end of the current line

New cards
64

r (vi text editor mode command)

Replace one character with the next character entered

New cards
65

R (vi text editor mode command)

Enter replace mode and continue to replace (overwrite) characters (until escape

New cards
66

u (vi text editor mode command)

 undo the previous command

New cards
67

. (vi text editor mode command)

Repeat the last edit

New cards
68

n. (vi text editor mode command)

Repeat the last edit command n times

New cards
69

nk (vi text editor mode command)

Repeat command k n times

New cards
70

x (vi text editor mode command)

delete the next character

New cards
71

dw (vi text editor mode command)

delete the next word

New cards
72

dd (vi text editor mode command)

delete this line

New cards
73

D (vi text editor mode command)

delete from the cursor to the end of the line

New cards
74

yy (vi text editor mode command)

copy the current line into a buffer

New cards
75

p (vi text editor mode command)

paste any lines below current lines

New cards
76

:w <enter> (vi text editor mode command)

save the file

New cards
77

:w name <enter> (vi text editor mode command)

 save the file as name

New cards
78

:q <enter> (vi text editor mode command)

exit vi

New cards
79

:q! <enter> (vi text editor mode command)

exit vi without saving

New cards
80

:wq <enter> (vi text editor mode command)

save file and exit vi

New cards
81

Shell scripts are stored in text files that must be both ___ ___

readable and executable

New cards
82

All bash shell scripts should start with the following line, which alerts the bash interpreter to execute

 #!/bin/bash

New cards
83

Input is accomplished through the ____ statement, which is usually followed by a variable. It will result in the cursor blinking on a blank line.

read

New cards
84

Two common forms of conditional statements

variable comparison value and filetest filename

New cards
85

-eq

equal to

New cards
86

-ne

not equal to

New cards
87

-gt

greater than

New cards
88

-lt

less than

New cards
89

-ge

greater than or equal to

New cards
90

-le

less than or equal to

New cards
91

-d (filetest condition)

item is a directory

New cards
92

-e (filetest condition)

file exists

New cards
93

-f (filetest condition)

file exists and is a regular file

New cards
94

-h (filetest condition)

item is a symbolic link

New cards
95

-r (filetest condition)

file exists and is readable

New cards
96

-w (filetest condition)

file exists and is writable

New cards
97

-x (filetest condition)

file exists and is executable

New cards
98

What is the notation for executing a script

./script <enter>

New cards
robot