Lecture 02 – Unix Fundamentals

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/35

flashcard set

Earn XP

Description and Tags

A set of question-and-answer flashcards covering key concepts from Lecture 02 on Unix fundamentals, including navigation, permissions, processes, kernel, shell, redirection, piping, and related commands.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

36 Terms

1
New cards

What is the primary role of an operating system?

To handle low-level tasks such as device communication, scheduling/running programs, and task management.

2
New cards

According to the Unix design philosophy, what is the fundamental concept that "everything" is treated as?

A file.

3
New cards

Why is Unix often preferred by programmers and advanced users over Windows or macOS?

It provides lower-level access and greater control over the system, without many of the restrictions found in more consumer-oriented OSes.

4
New cards

What symbol represents the top-level (root) directory in Unix?

/

5
New cards

Which command shows your current directory path?

pwd

6
New cards

Which command lists the contents of the current directory?

ls

7
New cards

Which command is used to change directories?

cd

8
New cards

In every directory, what does the single dot (.) represent?

The current directory.

9
New cards

In every directory, what does the double-dot (..) represent?

The parent directory.

10
New cards

What is the difference between an absolute and a relative path?

An absolute path starts from the root (/) and specifies the full location; a relative path is specified from the current directory.

11
New cards

Which command instantly returns you to the root directory?

cd /

12
New cards

What are the three Unix permission categories applied to a file?

User (owner), Group, and Other.

13
New cards

What three operations can be granted or denied in Unix file permissions?

Read, Write, and Execute.

14
New cards

In the permission string "-rwxr-xr--", what does the leading dash (-) indicate?

The file is not a directory (a directory would show a 'd').

15
New cards

In "-rwxr-xr--", what permissions does the owner (user) have?

Read, Write, and Execute (rwx).

16
New cards

In "-rwxr-xr--", what permissions does the group have?

Read and Execute (r-x).

17
New cards

In "-rwxr-xr--", what permissions does Other have?

Read only (r--).

18
New cards

Why must submitted bash scripts have global execute permission for assignments?

Because the automatic marking script needs to run (execute) them; without global execute, it will fail.

19
New cards

What is the basic function of the command chmod?

To change a file’s permission settings.

20
New cards

What does the command "chmod +x my_script.sh" do?

Adds (grants) execute permission to all users for the file my_script.sh.

21
New cards

In octal notation, what permissions does 7 represent?

Read, Write, and Execute (rwx).

22
New cards

What is the meaning of the octal permission 755?

User: rwx (7); Group: r-x (5); Other: r-x (5).

23
New cards

Define the kernel in the context of an operating system.

The core program that boots first, interfaces directly with CPU, memory and devices, and provides services to all other software.

24
New cards

Name two commands useful for listing system devices.

lsblk and lspci (lsusb is another).

25
New cards

What is the difference between a program and a process?

A program is static code (like a recipe); a process is a running instance of that code (the act of cooking).

26
New cards

If a parent process is terminated, what usually happens to its child processes?

They also terminate (though they can be configured to survive).

27
New cards

What is a Unix shell?

An interactive process that starts and manages other processes, providing a command-line interface to the user.

28
New cards

Which command lets you switch user (often to admin) in a terminal?

su (requires the target user’s password).

29
New cards

What happens if you start a GUI program from a terminal and then close the terminal window?

The GUI program (child process) usually closes as well, demonstrating parent-child dependency.

30
New cards

What does the command cp do?

Copies a file from one location to another.

31
New cards

What does the command mv do?

Moves or renames a file.

32
New cards

What does the command grep do?

Searches files for lines that match a given text pattern.

33
New cards

Which command counts lines, words, and characters in input text?

wc

34
New cards

What symbol is used for output redirection, and what does it do?

— sends (redirects) a program’s output to a file or another destination.

35
New cards

What symbol denotes a pipe, and what does piping accomplish?

| — connects the output of one command directly into the input of another.

36
New cards

Why is the C programming language closely linked with Unix?

Most of Unix was rewritten in C, and C provides many system calls (e.g., system(), execvp()) that interface directly with Unix features.