102-500 無料問題集「Lpi LPIC-1 Exam 102, Part 2 of 2, version 5.0」
Which command included in systemd supports selecting messages from the systemd journal by criteria such as time or unit name? (Specify only the command without any path or parameters.)
正解:
journalctl
Explanation:
The command journalctl is included in systemd and supports selecting messages from the systemd journal by criteria such as time or unit name. The systemd journal is a binary log file that stores system and service messages. The journalctl command can be used to view, filter, export, and manipulate the journal entries. For example, to show all messages from a specific unit, such as sshd.service, the command would be:
journalctl -u sshd.service
To show all messages from a specific time range, such as yesterday, the command would be:
journalctl --since=yesterday
The journalctl command has many options and arguments that can be used to customize the output and perform various operations on the journal. For more information, see the man page of journalctl or the official documentation1. Reference: [LPI 102-500 Exam Objectives], Topic 106.2: System logging, Weight: 3. [systemd-journald.service(8) - systemd - Debian unstable - Debian Manpages], Section NAME.
Explanation:
The command journalctl is included in systemd and supports selecting messages from the systemd journal by criteria such as time or unit name. The systemd journal is a binary log file that stores system and service messages. The journalctl command can be used to view, filter, export, and manipulate the journal entries. For example, to show all messages from a specific unit, such as sshd.service, the command would be:
journalctl -u sshd.service
To show all messages from a specific time range, such as yesterday, the command would be:
journalctl --since=yesterday
The journalctl command has many options and arguments that can be used to customize the output and perform various operations on the journal. For more information, see the man page of journalctl or the official documentation1. Reference: [LPI 102-500 Exam Objectives], Topic 106.2: System logging, Weight: 3. [systemd-journald.service(8) - systemd - Debian unstable - Debian Manpages], Section NAME.
What command displays all aliases defined in the current shell? (Specify the command without any path information)
正解:
aliasaliasp
Explanation:
The alias command is used to create, list, or remove aliases in the current shell. An alias is a short name that refers to another command, usually with some options or arguments. Aliases are useful for saving typing time, avoiding spelling errors, or customizing the behavior of commands. To list all the aliases defined in the current shell, we can use the alias command without any arguments. This will print the aliases in the format of alias name='command'123. For example:
$ alias alias cp='cp -i' alias l='ls -CF' alias la='ls -A' alias ll='ls -alF' alias mv='mv -i' alias rm='rm -i' The output shows that some common commands, such as cp, mv, and rm, have aliases that add the -i option, which prompts the user before overwriting or deleting files. The l, la, and ll aliases are shortcuts for different variations of the ls command, which lists files and directories123.
Explanation:
The alias command is used to create, list, or remove aliases in the current shell. An alias is a short name that refers to another command, usually with some options or arguments. Aliases are useful for saving typing time, avoiding spelling errors, or customizing the behavior of commands. To list all the aliases defined in the current shell, we can use the alias command without any arguments. This will print the aliases in the format of alias name='command'123. For example:
$ alias alias cp='cp -i' alias l='ls -CF' alias la='ls -A' alias ll='ls -alF' alias mv='mv -i' alias rm='rm -i' The output shows that some common commands, such as cp, mv, and rm, have aliases that add the -i option, which prompts the user before overwriting or deleting files. The l, la, and ll aliases are shortcuts for different variations of the ls command, which lists files and directories123.