LIOS Logs
logger writes a message into the system log from the shell or a script — the proper way to make your own scripts log like any other service.
Rather than scattering echo into ad-hoc files, logger hands your message to syslog/journald, so it lands in the same place as everything el...
Q What is an IPv4 address and how is it structured?
32 bits, written as four dotted decimal octets (0–255 each), split into a network portion and a host portion.
* One IPv4 address in dotted-decimal and binary — the 32 bits split into four octets. — Michel Bakni, CC BY-SA 4.0, via Wikimedia Commons. *
An IPv4 address is just a 32...
Q What is NetworkManager and how does nmcli interact with it?
NetworkManager is the daemon that owns network config; nmcli is its command-line client, structured as nmcli <object> <command> over connections and devices.
* NetworkManager separates connections (saved profiles) from devices (the NIC) — a device can hold several profiles but o...
Q How do you configure hostname and DNS resolution in Linux?
Set the hostname with hostnamectl set-hostname; name resolution is governed by /etc/hosts (local overrides), /etc/resolv.conf (DNS servers), and /etc/nsswitch.conf (lookup order).
Two related but separate things: the machine's own name, and how it resolves other names. hostnamect...
Q What commands are used to manage SELinux file contexts?
semanage fcontext records the PERMANENT rule for what a path's context should be, restorecon resets a file to that policy-defined context, and chcon slaps on a TEMPORARY context that the next relabel will undo.
* semanage fcontext (rule) vs restorecon (apply) vs chcon (temporary...
Q What is the root user and why should you avoid logging in as root?
Root is UID 0, the superuser the kernel exempts from every permission check; you avoid logging in as root because one mistake (or one compromised command) then has unlimited, unlogged reach.
The deeper reason is the principle of least privilege: you want to operate with only the...
Q How do you use chmod with the -R option and what are symbolic permission shortcuts?
-R walks a directory tree and applies the change to everything inside; bare operators like +x / -w / =r default to "all" (same as a+x) when you omit the who.
A real trap with recursive numeric modes: chmod -R 755 forces the execute bit onto files too, not just directories. Often...
Q How do you use top to monitor processes interactively?
top is an interactive, continuously-refreshing process monitor — a live view of CPU, memory, load, and the busiest processes.
Where ps is a single snapshot, top updates every couple of seconds, so it's what you open to catch what's happening right now — which process is pegging t...
Q What is a subnet and how does it divide an IP address?
A subnet is a set of hosts that share the same network portion and can reach each other directly (Layer 2) without going through a router.
The network/host split of an IP address is what defines a subnet: every host whose network portion matches is "local" to each other. Two host...
Q Where are NetworkManager connection profiles stored?
In three .nmconnection files dirs: /etc/... for your persistent profiles, /run/... for temporary ones, /usr/lib/... for vendor defaults.
The same three-tier layout systemd uses applies here: admin config in /etc (persistent, the one you usually edit), runtime/transient state in /...