2015 Objective Updates Flashcards
Upstart
A replacement daemon for the old SysVinit initialization program (For Debian/Ubuntu types)
/etc/init
Holds job configuration files
initctl list
List all jobs located in /etc/init
start jobname
starts a job (upstart)
stop jobname
stops a job (upstart)
restart jobname
restarts a job (upstart)
Systemd
A daemon that manages all other system daemons (For CentOS 7)
journald
Responsible for event logging in the system
journalctl
Used to query the coontents of the systemd journal
systemctl restart httpd.service
Restarts the service
systemctl enable httpd.service
Enable a service to start at boot time
systemctl stop httpd.service
Stop a service
systemctl isolate graphical.target
Moves into the graphical target
systemctl set-default graphical.target
Sets the default target to graphical.target
systemctl get-default
Tells you the current default target
System directory that contains the core system unit configuration files
/usr/lib/systemd/system
Custom configuration directory which is override by any matching configurations in the system unit configuration libraray
/etc/systemd/system
systemctl -t help
Display different unit types on the system
systemctl list-units –type=target | grep target
Overview of available targets
systemctl list-unit-files –type=target –all
Will show all targets, enabled and disabled
systemctl list-dependencies graphical.target
Will show the dependencies of the graphical target
wall
Reads standard input to broadcast messages to all logged in users
wall -n
Sends the broadcast without showing who the user is
How many primary partitions can GBT based partitions have?
128
How many primary partitions can MBR based partitions have?
4
How large can GPT based partitions be?
8 ZiB
How large can MBR based partitions be?
2 TiB
What are two tools used to manage GPT based partition tables?
gdisk
and
parted
screen
Will launch a new terminal screen on top of the other one
screen -d
Starts in detached mode and forks a new process
screen -S mysession
Starts a new session called mysession
screen -x mysession
Attach to mysession
screen -list
List all your current screens
screen -r mysession
Reattach to mysession
xz compression
Requires more memory during compression but has lower file size
xz -z myfile
Will compress myfile
xz -d myfile.xz
Decompresses myfile.xz
xz -l myfile.xz
Shows info about myfile.xz
How to compress a directory with xz
First use tar on the directory, then use xz to compress it
pgrep -u username
List all process associated with a user
pgrep -l -u username
List all processes associated with a user and display process name
pkill -t ttyid
Kill all processes started from a specific terminal
pgrep -v -u username
Show all processes that DO NOT belong to a user
pgrep -n
Shows the PID of the most recently started process
pgrep -l -u username sshd
Show all sshd processes associated with a user
pkill httpd
Kill all httpd processes
pkill -u username sshd
Kill all sshd processes for a specific user
dmesg
Command used to view the kernel messages in the kernel ring buffer
grub2-install /dev/device
Installs GRUB2 on device
How to make the grub2 configuration file?
grub2-mkconfig > /boot/grub2/grub.cfg