1/226
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
System
set of interconnected components (also called artifacts)
OS
software that lets you interact with computer, manages resources, and provides libraries
POSIX Standard
Portable Operating System Interface
OS Application Programming Interface and System Interfaces
Utilities
Programming Libraries
Command Interpreter
Unix OS Components
kernel, file system, shell, utilities
Kernel
RAM: Login, runs programs, basic common interface, memory management
File System
part RAM, part disk: Defines the way the disk drive is formatted, file allocation table, data structure that makes files real, reads and writes to disk, interacts with files based on user commands.
Shell
A user interface, global memory, commands to interact with OS
Utilities
Additional OS commands and programs, third party commands and programs
RAM contains (3)
Kernel, File System, Login
Disk contains (2)
shell, utilities
Login on Failure
Failed Login is recorded in utilities
Login on Success
Access the shell and replaces login with bash
Shell Functions
get user input, display OS info, store session information
Home Directory
Top folder in users directory tree (~)
Root Directory
Top folder in OS (/)
Current Directory
Directory currently within (.)
Parent Directory
Directory above the current directory (..)
Absolute Path
String begins at root
Relative Path
String begins at current location
Command Format
<Program> <switches> <arguments>
echo
prints message to terminal and can be quoted
directory listing
(ls) lists items in dierctory
long form listing
(ls -l) <permissions> <links> <owner> <group> <size> <modification date>
ls -a
display all files including hidden files
ls -l <file list>
see particular long format file
pwd
displays current directory path
cd <directory name>
change directory, must be accessible from current directory (or have right path)
mkdir [switches] <directory name>
makes a new directory
rmdir [options] directory
removes a directory
touch [options] file
creates a new empty file
cp [options] file1 file2
copies file 1 (file or file path) to file 2 (path, file or filepath) (creates or overwrites file 2)
mv [options] file1 file2
move file 1 into file 2
rm [options] file
removes a file or directory (need switches for directory)
cp/mv/rm -i
interactive: prompts for confirmation before proceeding
cp/rm -r/R
recursively visits directory, first visitiing files and subdirectories beneath it
mv/rm -f
Force: don’t prompt for confirmation
cat [options] files
file concatenate and display result
less [options] file
page through a text file
[command] > path
redirects the output of command to file at path (overwritten)
[command] » path
redirect output of command, appending to file at path
command1 | command2
redirects output of command1 to input of command2
logout
closes shell and logs you out
exit
closes shell and sends you to shell used to start exited one
ctrl+C
Terminates Programs
ctrl+D
Stop waiting for input
*
replaces any pattern
?
Replaces single character
square brackets []
any character within the brackets
[x-y]
character range
[!x]
matches any single character except x
globbing
passing input to program and expands wildcard matching patterns within segments BEFORE calling the command (shell does the work)
result when globbing fails
literal wildcards sent to program
grep [option] <string> <file list>
searches for occurrences of the string (surround with single quotes to avoid expanding wildcard or variables)
sed [options] <file list>
stream editor for editing files
awk [options] <file list>
scans for patterns in a file and processes the results
grep -i
ignore case
grep -c
returns count of number of lines containing matches
grep -v
inverts the search (displays only ones that do not match)
grep -n
displays line number along with lines with matches
grep -l
lists filenames but not lines
grep -E
pattern uses extended syntax
grep -e
followed by pattern
grep ^
anchor: matches beginning of string/line
grep $
matches end of string/line
(?#…)
comment “…” is ignored
(?:…)
Matches but doesn’t return “…”
(?=…)
matches if expressions would match “…” next
(?!…)
Matches if expression wouldn’t match “…” next
?
match 0 or one occurrences of previous item (use backslash)
+
match one or more occurrences of previous item (use backlash)
*
match zero or more occurrences of the previous item (use backslash)
.
any character except newline
STDIN
Standard In: keys typed by user are gathered
STDOUT
Standard Out: normal application output
STDERR
Standard Error: error output
<
Content of file sent as input to program
2>
Redirects standard error
Nested Execution
$(…)
tee
redirects to 2 places: <command> | tee <destination1> | <destination2>
File
single document in disk storage
TAR
(.tar) Collection of files stored within a single document
ZIP
(.zip) Single compressed document in disk storage
Archive
(.gz) collection of zip files in a single file
tar tool
combines several files into single file
gzip tool
compress a single file
.tar
tar archive file
.tgz
compressed tar archive file
tar -c <archivename> <filename>
creates a new tar archive
tar -r <archivename> <filename>
updates tar archive
tar -x <archivename> <path>
extracts from tar archive
tar -f <archivename> <path>
specifies archive file name
tar -v
activates verbose mode
tar -z
allows you to compress the archive
diff [options] file1 file2
compares two files
ln <filepath> link_name
creates hard link to file/folder (like giving file another name- points to the same same in disk) (can only delete once all hard links are gone)
ln -s <filepath> link_name
creates symbolic link, new file that automatically redirects to target file (deletion does not affect target file)
sort [options] file
sorts the lines of the file
wc [options] [file(s)]
displays a word/character/line count
File Owner
each file is owned by a use and a group
File Permission Groups
user, group and other