ps
.ps
: "A different set of processes can be selected for display by using any combination of the -a, -G, -g, -p, -T, -t, -U, and -u
options. If more than one of these options are given, then ps will select all processes which are matched by at least one of the given options".systemd
process starts during boot time, and remains active until the shutdown. It's the parent process for all other process in the system.top
command.job
, ps j
commands respectively.kill -l
to see the available signals to send to processes, like interrupt, terminate, resume, etc.killall
to operate on multiple processes using their executable name. Use pkill
for filtering with more options.pstree
and pgrep
to view process parent/child tree and search for processes by pattern./etc/passwd
and /etc/group
files.useradd
usermod
userdel
groupadd
groupmod
groupdel
uid
, and each group is associated with gid
.-g
and -aG
for users to replace group or append group, respectively:-L
, -U
options respectively.nologin
:passwd
interactively. Additionally change
command sets the password policy in the system.su - <username>
to switch to the specified user. which will promote for her password. Running the command without username will switch to the root user. To avoid cases where password is not available, use sudo
to switch accounts using current user password only and according to rules in /etc/sudoers
directory. Use sudo -i
to gain an interactive root shell.cat
cp
rm
mkdir
rmdir
touch
less
more
head
tail
grep
find
locate
wc
sed
date
to print the current date and time or others in the past and future:stdin
, stdout
, and stderr
where the first is for input stream and the latters for output and error streams.stdout
(equivalent to >
). You can explicity redirect to stdout
or stderr
as follows:/dev/null
.ssh
command used to connect to servers in secure manner using OpenSSH library using public key cryptography. The configuration and known hosts are kept under /etc/ssh
system-wide or in ~/.ssh/
in current user's home directory. On the other hand scp
is used for secure copy on secure shell fashion.ssh-keygen
: to generate new key pairs.ssh-copy-id
: to copy the public key to the remote machines.ssh-agent
: to simplify working with the private key passphrase if used.ssh-add
: to cache the passphrase in the current session.ls -l
, ls -ld
respectively.chmod
command and can be using symbols or digits.u
, g
, o
, or a
basis for the user, group, others, or all. Whereas, the digits are written for all at once in sequence for user, group, and others. Examples are below for both cases:chown
is used to change the ownership of folder/files to users or groups respectively. chgrp
is a shortcut to group change only. The root or the owner are only people can change ownership and in the latter, she needs to be part of the new target group before the change.suid s
, sgid s
, and sticky t
which control executable nature of files to be of owner users, and groups regardless of the current user. The last is to restrict deletion for only the root and owner always.systemctl
is the command used to list, manage, and check background processes or so called daemons
.enabled
and disabled
indicate wether a service is lanuched on startup or not. The subcommands enable
and disable
can be used to control this aspect.status
command or its state shortcuts:start
, stop
, restart
, and reload
, reload-or-restart
to control daemons.mask
and unmask
commands can be used to point a deamons config to dev/null
then back to normal respectively.crond
is responsible for managing the user's and system's scheduled jobs. Use the command crontab
to manage jobs and their files in the user account or in the system wide /etc/crontab
, /etc/cron.d/
locations.lscpu
to see the system's CPU in use and other details./var/log
directory. There are two categories of logs: 1. essential system logs via journald
, that are wiped across boots by default (can be configured to persist). 2. rsyslog
logs that persist by default and organized inside /var/log/
folder. Mainly, the logging mechanism in Linux follows the standard syslog
protocol for the system's messages, events, security incidents, mailing, and jobs logs, while other programs may or may not follow syslog
format identically.cat
, head
, tail
commands to interactively see or follow the logs.rsyslog
service and manage it as any daemon:journalctl
to view and follow the system's journald
log entries, which resides in /run/log/journal
./etc/hostname
.DHCP
) configured in /etc/resolv.conf
or manually in /etc/hosts
file.ping
utiltiy helps for connectivity checking:NetworkManager
is the kernel feature to manage network configurations in Linux. nmcli
is the terminal utility.apt
is the package manager, whereas for Fedora / RHEL, yum
is used./
./dev
directory by the OS, and has letters naming convention such as /dev/sda
, /dev/sdb
, /dev/vda
, and appended numbers in case of partitions /dev/sda3
. The attachment of the block device into the system is done through mounting it to a directory in the system.Ext4
.XFS
.Btrfs
.ZFS
.df
/du
commands:lsof
command lists all active processes using the block device./etc/fstab
file to determine devices to mount on the boot time.lsblk
and monunt
to check and mount filesystem devices, respectively.man
command to lookup the manual information on commands or topics in the system.info
command is the GNU documentation tool and provide more detailed materials.man -K <keyword
to search across manual).