美文网首页
Linux学习笔记

Linux学习笔记

作者: 陈而不旧 | 来源:发表于2016-12-02 23:08 被阅读0次

这个学习笔记是根据Redhat7《System Administrator's Guide》学习时所记下的部分要点。

chapter 1 Locale

the text console command is “localectl”,popular options:

  1. status
  2. list-locales
  3. set-locale LANG=
  4. list-keymaps
  5. ...

And we can use man localectl or localectl --helpfor help and more imformation;
the configuration file is located at /etc/locale.conf

chapter 2 Date and Time

the text console commands are timedatectl(which is new in RedHat 7),date(traditional command) and hwclock(for hardware)

timedatectl

part of systemd system and be able to change the configuration of system clock.

popular options:

  1. without option(display current date and time)
  2. restart system-timedated.services(if the chrony or ntpd was changed,better to run this command )
  3. set-time HH:MM:SS(similar to both use date --set and hwclock --systohc;will fail if ntp service works)
  4. set-local-rtc boolean(boolean is replaced by yes or no to determine to use local time or UTC)
  5. set-time YYYY-MM-DD(change the current date;without specifying the current time,the time will be setted to 00:00:00)
  6. list-timezones
  7. set-timezones timez_one
  8. set-ntp boolean(synchronizate the time from remote server using NTP protocol)

date

is availiable on all Linux systems.

popular options:

  1. without option(display the date and time)
  2. --utc/-u(display in UTC)
  3. +"format"(custom display using "%" and the first letter of the time word)
  4. --set HH:MM:SS
  5. --set HH:MM:SS --utc

ATTENTION:Careful about the distinguish of the component between timedatectl and date while setting current date and time,and the former is one component using the symbol '' besides the latter is both one and two component using the key space.

hwclock

When the operating system shutdown,the hardware clock keeps run.And this command configurates and managers the hardware clock.

popular options:

  1. without options
  2. --set --date "dd mmm yyyy HH:MM"
  3. --systohc
  4. --hctosys
  5. --systohc --localtime/--utc

chapter 3 Managing Users and Groups

see the reserved uid an gid by using this command:

cat /usr/share/doc/setup*/uidgid

It's recommended to assign non-reserved IDs starting from 5000,by changing the value of UID_MIN and GID_MIN in /etc/login.defs file.

User Private Group

相关文章

网友评论

      本文标题:Linux学习笔记

      本文链接:https://www.haomeiwen.com/subject/yiwqmttx.html