Final Superdeck Flashcards
3 special files with commands
stdin
stdout
stderr
0, 1, 2, respecitively
List of special/default directories.
/bin
/sbin
/lib
/usr
/etc
/home
/boot
/dev
/opt
/var
/tmp
/proc
/bin
binaries or executables. System programs like gcc, vim. Essential for the operation of the system itself.
/sbin
System binaries that should only be executed by the root (admin) user.
/lib
Libraries
/usr
user binaries, libraries, etc.
/etc
Editable text configurations, where configuration files are found
/home
User home (or personal) directories are here.
/boot
contains files needed to boot the system like the OS kernel
/dev
Device files. Allows interfacing with I/O devices with special files that are mapped to directories.
/opt
Optional software. Rarely used.
/var
Variables files that are changed as the system operates. Like log files.
/tmp
Temporary files not persisted between system rebootst.
/proc
An imaginary directory made by the kernel to keep track of processes.
How to go to home directory?
~ (tilde)
What does cat do?
Takes in a file as an argument, and outputs the contents to stdout. If a file is not given, it takes from stdin.
How to EOF in a command?
ctrl-d
What does > do in Bash?
Output redirection.
Redirects outputs of a command to a file.
Note that > creates (or overwrites).
» creates (or appends)
What does < do in bash?
Input redirection.
Tells the shell to get the input for a command from a specified file instead of a keyboard.
I.e.
command [arguments] < filename
Pipelines
Take stdout prior command and uses it as stdin to another.
How to increment a number (variable) in bash?
let x=x+1
Bash if else
if test-command
then
commands
elif test-command
then
commands
else
commands
fi
Bash while
while test-command
do
commands
done
Assembly is a ___ level language.
Low-level, since there is a 1-to-1 correspondence between statements and machine instructions.
Assembly is also machine dependent.