Karteikarten
Linux Flashcards
Karten in diesem Stapel (14)
- 1Define a Process and a Thread.Process: independent running program with it's own memory space, resources, and Process ID (PID)
Thread: Lightweight execution unit inside of a process. share the same memory space, run concurrently, are used for parallel tasks. - 2What are 3 reasons why you would use threads instead of processes?1. lower overhead
2. shared memory makes communication faster
3. useful for parallel workloads - 3Define the following commands for Checking CPU & Memory Usage: top, ps, free, df, & dutop: Shows live system usage.
ps: Shows running process.
free -h: Shows memory usage (human readable)
df: disk space
du: directory/file size - 4A simulation is running slowly. What 6 things could you check?1. CPU utilization
2. memory usage
3. swapping
4. disk space
5. number of processes
6. I/O bottlenecks - 5Permissions: What are the 3 groups and 3 permission types?groups: owner, group, others
permissions: read (r), write (w), execute (x)
Example: "-rwxr-xr--" ; owner: rwx, group: r-x, others: r-- - 6What do the chmod and chown commands do?chmod - change permissions
Example: "chmod +x script.sh" ; Makes script executable.
Example: "chmod 754 script.sh" ; 7 = rwx, 5 = r-x, 4 = r--
chown - Changes ownership.
Example: "chown user:group file.txt" - 7Name 4 reasons why are Environment Variables useful?1. configure tools without hardcoding paths
2. simplify automation
3. allow reusable scripts
4. manage tool versions - 8Define Pipes and Redirections.Pipe - Send output of one command into another.
Example: "cat log.txt | grep ERROR" (cat -> grep)
Redirection - changes the default destinations or sources of these streams, allowing you to save outputs to files, read input from files, or handle errors separately. - 9What are the 4 basic Redirection Operators?> : Redirects stdout to a file, overwriting the file if it exists.
< : Redirects stdin from a file instead of the keyboard.
2> : Redirects stderr to a file.
&> : Redirects both stdout and stderr to a file. - 10Define the grep command.grep - searches text for patterns.
Example: "grep ERROR sim.log" ; This prints all lines containing ERROR in sim.log file. - 11Define the awk command.awk - Used for extracting columns/data from reports.
$(#) - dereferences columns from left to right.
Example file (results.txt):
test1 PASS 10ns
test2 FAIL 15ns
Example - Print failed tests: "awk '$2=="FAIL" {print $1}' results.txt" - 12Define the sed command.sed - Stream editor used for text replacement.
Example: "sed 's/foo/bar/g' input.txt > output.txt"
s → substitute command
/foo/ → search pattern
/bar/ → replacement text
g → global flag (replace all matches in a line) - 13Define the find command.find - Find files or directories
Basic Syntax: find [path] [options] [expression]
Search by name: find /var/log -name "syslog"
Case-insensitive Search: find /var/log -iname "*.log"
Search by Type: find . -type d -name "backup"
Search by Size: find / -type f -size +100M
Search by Modification Time: find ~/Downloads -mtime -7 (modified in the last seven days)
Search by Permissions: find . -perm 644 - 14Define Swapping.A memory management technique used by operating systems to maximize CPU utilization and efficiently handle limited RAM.
It involves moving entire processes between main memory (RAM) and secondary storage (usually a hard disk or SSD) to ensure that active processes have enough memory to execute.
Informationen
- Beschreibung
- Digital Design Karteikarten am Linux Flashcards, erstellt von Bryce Reid am 19/05/2026.
- Erstellt von
- Bryce Reid
- Aufrufe
- 0
- Bewertung