Linux Core/Commands Flashcards
[Linux]
What commands do you use to change file permissions & ownership?
chmod (for permissions)
& chown (for ownership)
[Linux]
How would you start a service in RHEL?
Systemctl start [service name]
[Linux]
How would you install a package?
yum install [package name]
[Linux?]
What is SMTP & post-fix?
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)
[Linux]
Where are system log files typically stored for RHEL?
/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
[Linux]
What are IP tables?
a tool used to configure & manage packet filtering + network traffic rules.
[Linux]
What command is used patch manually?
$ yum update
[Linux]
What do you use /var/log or /var/log/messages for?
to check system logs
& messages regarding security events, user activities, application logs & kernel messages
ex: use ‘grep’ (search/find), ‘tail’ (last commands used), & ‘less’
[Linux]
What are some big differences between RHEL7 & RHEL8?
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)
[Linux]
How do you do rollbacks in RHEL/CentOs?
**From the snapshot
Using package manager:
$ dnf history undo [transaction_id]
[Linux]
What are the three components of the Linux OS?
Kernel (core)
Shell (CLI/User Interface)
File System (how data is stored, organized & accessed)
[Linux]
What is the difference between UNIX and Linux?
Unix: commercial (expensive), primarily used in enterprise environments
Linux: Open source, flexible, widely used (personal to enterprise)
[Linux]
What is bash?
Command-line shell (execute commands directly) & scripting language (for automating task)
ie: ls, cd, grep
[Linux]
What is a CronTab?
Config file used to schedule and automate task
(left to right: minute, hour, day, month, day-of-the-week)
[Linux]
What do you use the root account for?
unrestricted privileges & only critical system admin task.
It is best practice to use ‘sudo’ instead of direct root access
[Linux]
Where is the password file located in linux?
/etc/passwd
OR
(encrypted) /etc/shadow
[Linux]
What is chmod [file/folder]?
Change permissions of [file]
$ chmod [u/g/o + r/w/x] [files/dir]
[Linux]
What is a ext3 file system?
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
[Linux]
Difference between Linux and Unix
UNIX is proprietary & commercial while Linux is free & open source
[Linux]
What are the different files types in Linux?
files
directories
special files (represent devices ie /dev/sda)
Symbolic links (point to other files)
FIFO files [aka pipes] used for inter-process communication)
[Linux]
How do you check CPU usage?
$ top or $ htop
[Linux]
What are the different run levels in Linux?
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
[Linux]
What command to check current runlevel?
$ runlevel