Identify Features of Linux Flashcards

Lesson 15A (61 cards)

1
Q
A

Ubuntu 20 running the GNOME desktop with a virtual terminal window open to run commands
in the Bash command environment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
A

Viewing the root directory and file system hierarchy standard (FHS) subdirectories in Ubuntu Linux.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
A

Listing package manager sources in Ubuntu Linux.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
A

Listing all processes on the system. Note that a question mark indicates that a process has no controlling terminal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
A

Listing the state of running processes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

kernal

A

the core of the operating system, acting as the bridge between hardware and software applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

distribution (distro)

A

a complete, packaged operating system built upon the Linux kernel.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

shell

A

a command-line interpreter that acts as an interface between the user and the operating system’s kernel.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

bash

A

is a powerful command-line interpreter and scripting language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

shell

A

Linux provides various shell environments, such as Bash, zsh, and ksh, enabling users to interact with the OS and applications. These shells differ in functionality, including tab completion, command history, and syntax highlighting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

distros

A

Many Linux distros operate without a graphical interface, relying on a terminal connected to the shell via a teletype (tty) device. Input and output are managed through three primary streams:
- stdin (0): User keyboard input
- stdout (1): Displays shell-generated output
- stderr (2): Handles error messages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

For systems with a graphical desktop environment, Linux uses Xorg as the display system.

A

Popular desktop environments include Gnome, KDE, Cinnamon, and Xfce. Within these, a terminal emulator allows users to access the command shell.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Console switching lets users toggle between multiple tty consoles using:

A

CTRL+ALT+Fx, where each console can support distinct login prompts and shells.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Linux commands

A

consist of a command name, optional switches for modifying behavior, and arguments that specify data; execution can be streamlined using pipes (|) for redirection or semicolons (;) to run multiple commands sequentially.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

executable

A

is a file that the operating system can directly run to execute a program or script.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

PATH

A

is an environment variable that lists the directories where the shell searches for executable files when a command is entered.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

switches or options

A

They are used to customize a command’s actions, for example, enabling or disabling features, or providing additional instructions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Arguments

A

are values supplied to the command for it to operate on, such as file names. Arguments must be supplied in the correct order for the command’s
syntax.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

semicolon

A

You can issue more than one command on a single line by placing a semicolon ( ; ) between the commands.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Command –help

A

The help is often several pages long so it common to pipe the output to the** more **command. more shows the results a page at a time. For example: ls
–help | more

Alternatively, you can use **man **to view the help pages for a particular command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Linux file editors like Nano

A

provide a simple interface with keyboard shortcuts, while vi/vim offer advanced functionality using insert and command modes, requiring specific keystrokes for editing (i for insert, :w to save, :q! to quit without saving). esc key to escape mode.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Linux organizes everything as files within a unified file system:

A

starting at /, distinguishing devices like /dev/sda for storage, avoiding Windows-style drive letters, and following the File System Hierarchy Standard (FHS) for directories like /home for user data and /etc for configurations, navigation using commands like pwd, cd, ls, and cat.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Navigation Commands

pwd command

A

The **pwd** command displays the current working directory, because any commands you use which don’t specify a path as an argument will
default to the working directory; some Linux prompts show this location directly or represent the home directory with a tilde (~).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Navigation Commands

cd command

A

changes the current working directory, allowing navigation between directories using absolute paths (e.g., cd /etc from root), relative paths (e.g., cd documents within the current directory), or moving up one level (cd ..).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
# Navigation Commands The **`ls`** command
lists directory contents, similar to `dir` in Windows, with options like `-l` for a detailed view and `-a` for showing hidden files, as seen in `ls -la /etc`, which provides a full, formatted listing of the `/etc` directory.
26
# Navigation Commands The `cat` command
displays file contents, with options like `-n` to add line numbers; output can be **paged** (`cat | more` or `cat | less`), **overwritten** (`cat > file`), or **appended** (`cat >> file`), and redirection operators apply to other commands as well.
27
# Navigation Commands cat command
is a versatile utility used for displaying, creating, and manipulating text files.
28
# Search Commands The `find` command
searches for files using a **path** and **expression**, with options like `-name` (file name), `-size` (file size), `-user` (owner), and `-perm` (permissions); unlike Windows, where file types are defined by extensions, Linux's `-type` distinguishes files, directories, block devices, sockets, symbolic links, and pipes.
29
# Search Commands The `grep` command
searches and filters file contents, matching either **literal text** or **regular expressions (regex)**; useful for scanning large files like system logs (`grep -i "uid=1003" /var/log/messages`), it can also filter directory listings (`ls -l | grep audit`).
30
# search command Metacharacters and Escaping
in Linux have special meanings and require **escaping** to be treated as literals, using `\` for single-character escaping (`\*` for `*`), **single quotes (`'`)** for strong escaping (preserving everything as literal), and **double quotes (`"`)** for weak escaping, which allows variable expansion and command substitution.
31
File Management Commands
File management commands are used to move, copy, and delete data.
32
# File Management Commands The `cp` command **cp file1.txt file1.old**
Copy file1.txt in the current working directory to a new file called file1. old in the same directory
33
# File Management Commands cp command cp /etc/hosts /tmp
Copy the file hosts from the directory /etc into the directory /tmp, keeping the file name the same
34
# File Management Commands cp command cp -v /var/log/message* /home/david
Copy all files beginning with the name message from the /var/log directory into /home/david. The -v option displays the files copied
35
# File Management Commands The `mv` command
moves files between directories or renames them, such as keeping the same name when relocating (`mv /home/david/data.txt /tmp`), renaming while moving (`mv alarm.dat /tmp/alarm.bak`), or renaming within the same directory (`mv /var/log/app1.dat /var/log/app1.old`).
36
# File Management Commands The `rm` command
deletes files and directories, with simple file removal (`rm data.old`), wildcard-based deletion (`rm /var/log/*.bak`), and recursive directory removal (`rm -r /home/david/data`).
37
# File Management Commands The `df` command (“disk free”)
shows available disk space, including file system details and usage percentages, while the `du` (“disk usage”) command reports storage consumption, displaying sizes of directories and files.
38
# User Account Management The **root user**
in Linux has full administrative privileges and should only be used when necessary; instead, regular user accounts are created for daily tasks, with privilege elevation managed through special commands rather than remaining logged in as root.
39
# User account management The `su` command (switch user)
switches to another user account, prompting for the target user's password; omitting the username switches to **root**, while `su -` launches a new shell under **root's** full environment, making it the preferred method.
40
# User Account Management The `sudo` command (superuser do)
grants temporary superuser privileges to users listed in the `/etc/sudoers` file, allowing them to execute specific commands with administrative rights, often requiring password confirmation if not recently cached.
41
# User Account Management user management commands
User settings are stored in `/etc/passwd`, group settings in `/etc/group`, and encrypted password hashes in `/etc/shadow`; user accounts can be managed with `useradd` (add), `usermod` (modify), and `userdel` (delete), while passwords can be updated using the `passwd` command.
42
# User Account Management Group Management Commands
Users in Linux are assigned to groups for managing file permissions, with **groupadd**, **groupmod**, and **groupdel** handling group membership, while **newgrp** allows users to switch their **effective group ID**, as listed in `/etc/passwd`.
43
File Permissions Commands
control access using three rights: **read (`r`)** for viewing, **write (`w`)** for modifying or deleting, and **execute (`x`)** for running files or accessing directories; permissions are assigned to the **owner, group, and others**, represented in **symbolic notation** (`rwx`, `r-x`, `r--`) or **numeric notation** (`7` for full rights, `5` for read/execute, `4` for read-only).
44
# File permssion values File permissions commands use **octal values (0–7)**
to represent access levels: **read (4)**, **write (2)**, and **execute (1)**. Adding these defines specific permissions—for instance, `0754` translates to **owner (`7 = rwx`), group (`5 = r-x`), and others (`4 = r--`)**. A common alternative is `6`, granting **read and write** access.
45
Linux file permissions use symbolic notation
(r, w, x, or -) to define access levels for the owner, group, and others. For example: - drwxr-xr-x indicates a directory (d), where the owner has full access (rwx), the group and others have read/execute (r-x).
46
# file permissions The `chmod` command
modifies file and directory permissions using **symbolic notation** (`rwx`, `r-x`, etc.) or **octal values** (`755`, `644`, etc.), ensuring security control; only the **owner** can alter permissions.
47
# file permssions The `chown` command
lets the **superuser** change a file or directory's **owner**, but regular users **cannot** modify ownership, even for their own files; however, they **can** change the file's **group** using the `chgrp` command.
48
Package Management Commands
Linux software can be installed as **source code** (requiring compilation) or **pre-compiled packages** managed by **package managers**, which vary by distribution: - **APT (Advanced Packaging Tool)**: Used in **Debian-based** systems, handles `.deb` packages. - **YUM (Yellowdog Updater, Modified)**: Used in **Red Hat-based** systems, manages `.rpm` packages. These tools simplify software installation and updates across different Linux distributions.
49
Distributions and Repositories
Linux **distributions** package precompiled software, hosted in **repositories** containing supported, beta, and experimental versions. **Package managers** configure repository URLs for installing, updating, or removing software. Security is ensured through **cryptographic hashes** (MD5, SHA-256) or **GNU Privacy Guard (GPG) signing**, verifying package integrity before installation.
50
# package management tool The `apt-get` command
for **APT** in Debian-based systems, used for updating and installing software: - `apt-get update` refreshes the local package database. - `apt-get upgrade` installs updates for all packages. - `apt-get install PackageName` installs a specified application. This streamlines software maintenance in Linux environments.
51
# package management tooll The `yum` command
for **YUM** in Red Hat-based systems, used for installing and updating software: - `yum check-update` refreshes the local package database. - `yum update` upgrades all installed packages to the latest versions. - `yum install PackageName` installs a specified application. This simplifies software maintenance across Red Hat distributions.
52
anti-virus
Linux is **resistant to widespread malware** but still faces **targeted attacks and repository vulnerabilities**, making tools like **ClamAV** and **Snort IPS** essential for securing web servers and preventing malware transmission to Windows systems.
53
# Process Monitoring Commands The `ps` command
retrieves the **process table**, showing currently running processes. Without options, it lists processes from the **current shell**, including **PID**, associated terminal, CPU time, and initiating command. Additional options refine the display to filter specific fields or processes.
54
Process Monitoring Commands
Each Linux process has a unique **process ID (PID)**, a **non-negative integer** that increments for every new process; **PID 1** is assigned to the `init` daemon, the first process that starts and the **parent of all others**, while subsequent processes receive increasing PID values.
55
# Process Monitoring Commands The `top` command
dynamically monitors **running processes** in real-time, allowing **sorting, prioritization, and termination**. Common keystrokes include: - **ENTER**: Refresh process statuses. - **SHIFT+N**: Sort by descending **PID**. - **M**: Sort by **memory usage**. - **P**: Sort by **CPU usage**. - **u**: Filter by **specific user**. - **q**: Exit process monitoring. This makes `top` an essential tool for system performance management.
56
Network Management Commands
interfaces using names like `eth0`, `eth1`, etc., though modern distributions may use **`en` prefixes**. **Running configurations** apply in real-time, while **persistent configurations** remain after reboot. Traditional setups modified `/etc/network/interfaces` and used `ifup`/`ifdown` scripts, but many distributions now rely on **NetworkManager** (`nmcli` tools) or **systemd-networkd** for streamlined network configuration management.
57
# Network Management Commands The `ip` command
part of **iproute2**, replaces legacy **net-tools** commands like `ifconfig`, providing modern network management for **interfaces, addresses, and routes**; changes made with `ip addr` and `ip link` affect the **running configuration** but aren't persistent unless included in a **startup script**.
58
# Network Management Commands The `dig` command
Is a powerful **DNS lookup tool**, commonly available on Linux distributions, used to **test name resolution** and gather domain-related information. Its output includes: - The **IP address** mapped to a domain. - The **DNS server** that responded. - The **query response time**. Basic usage: - `dig domainname` queries the default DNS. - `dig @server domainname` resolves the domain using a **specific DNS server**. This command is essential for troubleshooting domain resolution issues.
59
# Network Management Commands **Samba
is an **SMB-compatible file sharing protocol** for Linux, allowing seamless **integration** with Windows systems. A Linux workstation with Samba can **access shared Windows resources**, while a Linux server running Samba can **share directories to Windows clients** using the **SMB protocol**. **
60
Backup and Scheduling Commands
Linux lacks an **official backup tool**, but users can create custom solutions using **cron** for scheduling and **tar/gzip** for compression. Open-source tools like **Amanda, Bacula, Fwbackups, and Rsync** provide structured backup options. The **cron task scheduler** allows users to manage **automated jobs** via **crontab**, where commands like `crontab -l`, `crontab -r`, and `crontab -e` help list, remove, and edit scheduled tasks. Jobs are scheduled using a **time-based syntax** (minute, hour, day, month, weekday, command), with wildcard options (`*`, `,`, `-`, `/2`) enabling flexible scheduling. A typical crontab entry might run an **Rsync backup** at a specific time (e.g., `15 02 * * 5` for **Friday at 2:15 a.m.**).
61
For example, consider the following crontab entry: **§ 15 02 * * 5 /usr/bin/rsync –av --delete /home/ sam/mount/rsync**
This would cause the system to run the rsync backup program at 2:15 a.m. on a Friday (day 5), synchronizing the** /home/sam** directory with the **/mount/sync** folder (which could be a mount point to an external backup device).