Looks like no one added any tags here yet for you.
Tilde expansion ~
Brace expansion {}
Can act as anything , * “match anything”
A command that prints text or variable values to the terminal. You can also view the contents of a variable using this command.
What does typing !number where number is the number of the entry in the history list do?
Recalls an instruction from the history list
control+f
move cursor forward one character
control+b
move cursor backward one character
Escape key+f
move cursor forward one word
escape key+b
move cursor backward one word
control+a
move cursor to the beginning of the line
control+e
move cursor to the end of the line
control+d
delete the character where the cursor is at
control+k
kill(delete) the contents from the cursor to the end of the line
control+w
delete all the characters before the cursor to the beginning of the word
control+y
take whatever was recently deleted and yank it back put it in current cursor position
control+_
undo the last editing operation (delete or paste)
(T/F) Bash will treat any number as a string unless you specify that it should be a number
True
How do we change a number to a number and not a string in bash?
Enclose in parantheses
How would we obtain a value stored in a variable?
Add $ before variable name
How would we reference the command date ?
` date `
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
How to add to your PATH variable?
PATH=$PATH:/home/nameofdirectory
< redirection
redirect the input to come from an input file
> redirection
redirect the output to go to an output file, overwriting the file if it already exists.
>> redirection
redirect the output to be appended to an already existing file, or create the file if it does not exist
<< redirection
redirect the input to come from keyboard where input will terminate with a special keyword that you specify after
| redirection
redirect the output of one command to be the input of another
Most common form of help; use this command for knowing about an instruction
man command
How does the find command differ from the man command?
Includes list of examples
Apropos
allows us to search for a command based on what it accomplishes/does.
3 common text editors
GUI editor : Text Editor
vi
emacs
3 different modes of vi
command mode, insert mode and replace mode.
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
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.
Replace mode
mode in vi that as you enter keystrokes the characters overwrite the characters already present.
o (vi text editor mode command)
insert a blank line after the current line and enter insert mode
O (vi text editor mode command)
insert a blank line before the current line and enter insert mode
I (vi text editor mode command)
Enter insert mode at the beginning of current line
A (vi text editor mode command)
Enter insert mode at the end of the current line
r (vi text editor mode command)
Replace one character with the next character entered
R (vi text editor mode command)
Enter replace mode and continue to replace (overwrite) characters (until escape
u (vi text editor mode command)
undo the previous command
. (vi text editor mode command)
Repeat the last edit
n. (vi text editor mode command)
Repeat the last edit command n times
nk (vi text editor mode command)
Repeat command k n times
x (vi text editor mode command)
delete the next character
dw (vi text editor mode command)
delete the next word
dd (vi text editor mode command)
delete this line
D (vi text editor mode command)
delete from the cursor to the end of the line
yy (vi text editor mode command)
copy the current line into a buffer
p (vi text editor mode command)
paste any lines below current lines
:w <enter> (vi text editor mode command)
save the file
:w name <enter> (vi text editor mode command)
save the file as name
:q <enter> (vi text editor mode command)
exit vi
:q! <enter> (vi text editor mode command)
exit vi without saving
:wq <enter> (vi text editor mode command)
save file and exit vi
Shell scripts are stored in text files that must be both ___ ___
readable and executable
All bash shell scripts should start with the following line, which alerts the bash interpreter to execute
#!/bin/bash
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
Two common forms of conditional statements
variable comparison value and filetest filename
-eq
equal to
-ne
not equal to
-gt
greater than
-lt
less than
-ge
greater than or equal to
-le
less than or equal to
-d (filetest condition)
item is a directory
-e (filetest condition)
file exists
-f (filetest condition)
file exists and is a regular file
-h (filetest condition)
item is a symbolic link
-r (filetest condition)
file exists and is readable
-w (filetest condition)
file exists and is writable
-x (filetest condition)
file exists and is executable
What is the notation for executing a script
./script <enter>