Change time & date & timezone

  • Display the current time and date: timedatectl or timedatectl status
  • Check if NTP is enabled: timedatectl | grep "NTP enabled"
  • Disable automatic synchronization (stops chronyd service): timedatectl set-ntp no
  • Set time: timedatectl set-time "16:24:00"
  • Set date: timedatectl set-time "2017-03-03"
  • Set date and time: timedatectl set-time "2017-03-03 16:25:20"
  • List zones: timedatectl list-timezones
  • Set timezone: timedatectl set-timezone Europe/Bucharest
  • View detailed NTP specific information: chronyc tracking
  • View all NTP servers that chronyc is synchronizing with chronyc sources


  • chrony is the default NTP client/server
  • /etc/chrony.conf is the configuration file


  • Set an IP address: ip addr add dev enp0s3
  • Delete the IP address: ip addr del dev enp0s3
  • Display the settings for the interface: ip addr show enp0s3
  • Show routing table entries: ip route show
  • Change the default gateway: ip route add default via
  • Display ARP entries: ip neighbour
  • Show network statistics: ip -s link
  • Activate/deactivate an particular interface: ip link set enp0s3 up or ip link set enp0s3 down


  • Installation: yum install NetworkManager-tui
  • Start the service: systemctl status NetworkManager.service
  • Configure the interfaces: nmtui or nmtui edit enp0s3


  • The location of all definitions: /lib/firewalld/services or /usr/lib/firewalld/services
  • Add new configuration files: /etc/firewalld/services
  • Configuration file: /etc/firewalld/firewalld.conf
  • Configuration zone files: /etc/firewalld/zones
  • Log file: /var/log/firewalld
  • Check the service: systemctl status firewalld
  • List services added: firewall-cmd --list-services
  • List ports added for zone: firewall-cmd --list-ports
  • Reload firewall rules and keep state information: firewall-cmd --reload
  • Check whether the firewalld daemon is active: firewall-cmd --state
  • Add a service: firewall-cmd --add-service=dns --permanent
  • Add a specific port: firewall-cmd --add-port=80/tcp --permanent
  • List all zones: firewall-cmd --get-zones
  • List the default zone: firewall-cmd --get-default-zone
  • List zones where you’ve got network interfaces: firewall-cmd --get-active-zones
  • Change the default zone: firewall-cmd --set-default-zone=internal
  • Convert runtime rules into permanenet rules: firewall-cmd --runtime-to-permanent
  • Display configuration of the public zone: firewall-cmd --permanent --zone=public --list-all
  • Temporary add several services (http, https): firewall-cmd --zone=public --add-service={http,https}
  • Get details about https: firewall-cmd --info-service=https
  • Add a rich rule (/var/log/messages): firewall-cmd --add-rich-rule 'rule family="ipv4" source address="" log accept'
  • Save the configuration file: iptables -S > /tmp/firewalld_rules_ipv4


Do not edit /boot/grub2/grub.cfg by hand !

  • Configuration files:

    • /boot/grub2/grub.cfg (or symbolick link /etc/grub2.cfg)
    • /etc/default/grub
    • /etc/sysconfig/kernel
    • /etc/grub.d directory
  • List all kernel entries:

grubby --info=ALL
grep ^menuentry /boot/grub2/grub.cfg | cut -f 2 -d \' | nl -v 0
grep ^menuentry /etc/grub2.cfg  | awk -F'--' '{print $1}'
  • Add an argument: grubby --args "rhgb" --update-kernel /boot/vmlinuz-3.10.0-693.1.1.el7.x86_64
  • Remove "rhgb quiet LANG=en_US.UTF-8" arguments: grubby --remove-args "rhgb quiet LANG=en_US.UTF-8" --update-kernel /boot/vmlinuz-3.10.0-693.1.1.el7.x86_64
  • Updating all kernel with the same argument: grubby --args="rdblacklist=lpfc" --update-kernel=ALL
  • Remove the argument for all kernels: grubby --remove-args="rdblacklist=lpfc" --update-kernel=ALL
  • Rebuild grub.cfg (after editing /etc/default/grub):
cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.bkp
grub2-mkconfig -o /boot/grub2/grub.cfg
  • Display the numeric index of the current default boot entry: grubby --default-index or grub2-editenv list
  • Set the default boot menu entry for GRUB (file /boot/grub2/grubenv): grubby --set-default-index 3 or grub2-set-default 3
  • Display the full path to the current default kernel: grubby --default-kernel
  • Display information on all boot entries which match kernel-path: grubby --info /boot/vmlinuz-3.10.0-693.11.1.el7.x86_64