Linux Core/Commands Flashcards

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

[Linux]
What commands do you use to change file permissions & ownership?

A

chmod (for permissions)
& chown (for ownership)

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

[Linux]
How would you start a service in RHEL?

A

Systemctl start [service name]

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

[Linux]
How would you install a package?

A

yum install [package name]

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

[Linux?]
What is SMTP & post-fix?

A

smtp = (Simple Mail Transfer Protocol) is a set of rules for sending and receiving emails over the internet using TCP & default port 25

Post-fix = open source, fast, secure, easy-to-configure MTA (mail transer agent), uses port 25 (typical SMTP port)

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

[Linux]
Where are system log files typically stored for RHEL?

A

/var/log/messages = general system messages
+journalctl -k (for kernel logs)

/var/log/secure = authentication logs

/var/log/httpd = Apache web server logs (access & error logs)

/var/log/cron = logs of scheduled CRON jobs

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

[Linux]
What are IP tables?

A

a tool used to configure & manage packet filtering + network traffic rules.

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

[Linux]
What command is used patch manually?

A

$ yum update

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

[Linux]
What do you use /var/log or /var/log/messages for?

A

to check system logs
& messages regarding security events, user activities, application logs & kernel messages

ex: use ‘grep’ (search/find), ‘tail’ (last commands used), & ‘less’

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

[Linux]
What are some big differences between RHEL7 & RHEL8?

A

1) Package management:
RHEL7 uses YUM
vs
RHEL8 uses DNF (faster & more efficient)

2) Kernal Upgrade:
RHEL7 uses 3.10
vs
RHEL8 uses 4.18 (better hardware support, performance & security)

3) Software Packaging
RHEL7 uses traditional RPM packaging
vs
RHEL8 introduces Application Streams, allowing multiple versions of software to be installed and maintained simultaneously

4) Networking
RHEL7 uses iptables for firewall management
vs
RHEL8 replaces ‘iptables’ with ‘nftables’ (simplifies network filtering) + ‘network-scripts’ is now ‘NetworkManager’

5) Security Enhancements
RHEL8 improves encryption & security compliance (with OpenSSL 1.1.1 + TLS 1.3), system-wide cryptographic policies, & rootless containers (reducing the need for root privileges)

6) Desktop Environment
RHEL7 uses GNOME 3.22 with X.org
vs
RHEL8 uses GNOME 3.28 with Wayland (X.org still available)

7) Storage & Filesystem Changes
RHEL7 supports XFS, ext4 and Brtrf
vs
RHEL8 drops Btrf, (keeps XFS & ext4) + adds Stratis (easier storage management)

8) Containerization changes
RHEL7 uses Docker
vs
RHEL8 drops Docker and uses Podman, Buildah & Skopeo (more secure & rootless containers)

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

[Linux]
How do you do rollbacks in RHEL/CentOs?

A

**From the snapshot

Using package manager:
$ dnf history undo [transaction_id]

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

[Linux]
What are the three components of the Linux OS?

A

Kernel (core)
Shell (CLI/User Interface)
File System (how data is stored, organized & accessed)

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

[Linux]
What is the difference between UNIX and Linux?

A

Unix: commercial (expensive), primarily used in enterprise environments

Linux: Open source, flexible, widely used (personal to enterprise)

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

[Linux]
What is bash?

A

Command-line shell (execute commands directly) & scripting language (for automating task)

ie: ls, cd, grep

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

[Linux]
What is a CronTab?

A

Config file used to schedule and automate task

(left to right: minute, hour, day, month, day-of-the-week)

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

[Linux]
What do you use the root account for?

A

unrestricted privileges & only critical system admin task.
It is best practice to use ‘sudo’ instead of direct root access

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

[Linux]
Where is the password file located in linux?

A

/etc/passwd
OR
(encrypted) /etc/shadow

18
Q

[Linux]
What is chmod [file/folder]?

A

Change permissions of [file]
$ chmod [u/g/o + r/w/x] [files/dir]

19
Q

[Linux]
What is a ext3 file system?

A

3rd extended file system; slowly being phased out by ext4.

major upgrade over ext2 was JOURNALING, which improved reliability (data integrity) & prevented data corruption during power loss or system crash (fast recovery)
-easily convert ext2 to ext3
-not as scalable as ext4 or XFS
-doesnt handle large files/volumes as well as ext4

20
Q

[Linux]
Difference between Linux and Unix

A

UNIX is proprietary & commercial while Linux is free & open source

21
Q

[Linux]
What are the different files types in Linux?

A

files
directories
special files (represent devices ie /dev/sda)
Symbolic links (point to other files)
FIFO files [aka pipes] used for inter-process communication)

22
Q

[Linux]
How do you check CPU usage?

A

$ top or $ htop

23
Q

[Linux]
What are the different run levels in Linux?

A

0 = HALT (shuts down the system)
1 = Single-user mode (for maintenance)
2 = Multi-user mode w/o networking
3 = Multi-user mode WITH networking
4 = unused/customizable
5 = Multi-user w/ GUI
6 = REBOOT

24
Q

[Linux]
What command to check current runlevel?

A

$ runlevel

25
Q

[Linux]
What command to change runlevel?

A

$ init [number] = switch to runlevel [number]

26
Q

[Linux]
How to create, delete and assign password for users in Linux?

A

$ useradd [username]
$ userdel [username]
$ passwd [username]

27
Q

[Linux]
explain hardlink vs softlink

A

A hard link is a direct reference to the data vs a softlink is a shortcut/reference to another file or directory.

28
Q

[Linux]
How do you check disk usage?

29
Q

[Linux]
How do you check memory usage?

30
Q

[Linux]
How do you check network usage?

A

$ iftop or $ netstat -tulnp

31
Q

[Linux]
How do you check Disk I/O usage?

32
Q

[Linux]
What is SELinux? & its purpose?

A

a module that increases security by limiting process actions

extra features: Type Enforcement (TE), Role-Based Access Control (RBAC), Multi-Level Security (MLS)

33
Q

[Linux]
What is fstab?

A

(File System Table): contains information about disk partitioning & storage devices that should be automatically mounted at boot
-located in /etc/fstab

34
Q

[Linux]
What are the modes of SELinux?
& how to check current mode

A

Enforcing, Permissive, & Disabled.
Check by using: $ sestatus

35
Q

[Linux]
How to change modes in SELinux, temporarily & permanently

A

Temp: $ setenforce 1 or 0 [1=enforcing, 0=permissive]

Perm: goto /etc/selinux/config change “SELINUX=____” to enforcing, permissive or disabled, then save & reboot.

36
Q

[Linux]
What is an inode?

A

An inode (Index Node) is a data structure used by file systems in Linux to store metadata about a file or directory.
(harddrive identifier)

It contains information such as:
File type, Permissions, Ownership, Size of the file, Timestamps

37
Q

[Linux]
What file stores a user encrypted password?

A

etc/shadow

38
Q

[Linux]
how do you check cpu usage?

A

$ htop / $ top

39
Q

[Linux]
How to list running processes?

A

$ ps -a / $ top

40
Q

[Linux]
What does $ SU command do?

A

switch user