業務用エアコン関連の技術情報、エラーコード、環境問題対策に関する別サイト「エアコンの安全な修理・適切なフロン回収」

nuy

LinuxTips(RedHat)_en

Checking a user's login history

The user's login history will be output to the /var/run/utmp and /var/log/wtmp files.This file, like the /var/log/lastlog and /var/log/btmp files, is a binary file, so it cannot be displayed by the less, cat, or tail commands.To display it, use the dedicated /usr/bin/last command.
LinuxTips(RedHat)_en

Show user's group affiliation

To check which group a particular user belongs to, use the groups command.If you run the command with no arguments, the group to which the user who executed the command belongs will be displayed.If you specify the name of the user whose group you want to display as an argument, the group to which the user belongs will be displayed.
LinuxTips(RedHat)_en

Add and delete groups

●Add a groupTo create a group, use the groupadd command.When executing this command, specify the group name to be added as an argument. You will need root privileges to run this command.
LinuxTips(RedHat)_en

Set and Remove passwords for groups

To set a password for a group, use the gpasswd commandYou will be prompted to enter a password when adding a user to a group or when a user is not registered in a group.By setting a password for the group, you can prevent people from registering members to the group without permission.
LinuxTips(RedHat)_en

Set up an administrator for the group.

You can set up an administrator for an existing group separately from root (privileged user).The administrator set here can add and remove members, set and remove group passwords, etc. for the group.To set up an administrator, add the option "-A" to the gpasswd command and specify the user name and the group name to be managed as arguments.Multiple users can be specified by separating them with a comma ",".
LinuxTips(RedHat)_en

Adding and removing members to a group

●Add members to a groupTo add a member to an existing group, run the gpasswd command with the option "-a".The argument is the name of the user or group to be added and executed.This process can be executed by root or a user registered as a group administrator.
Directory and file operations

Show all files in a directory

To view the files in a directory, use the "ls" command. However, files beginning with a ". (dot) is a hidden file and cannot be displayed by the "ls" command.." (dot), you can use the "ls" command with the option "-a".
Directory and file operations

Checking symbolic links

A symbolic link looks like a normal file, but the actual file is in a different directory. To check whether a file is a symbolic link or not, run the ls command with the "-l" option.
Directory and file operations

Change the default permissions for files and directories

When you create a new file or directory, it will have default permissions. To change the default permissions, use the umask command.Permissions in octal notationflag notation     rwxcorresponding octal number      421
Directory and file operations

Changing the ownership of files and directories

To change the ownership of a file or directory, use the chown command.If you want to change the ownership of all files in a directory, run it with the -R option.
Directory and file operations

Create a multi-level directory in one go

To create a directory, specify the directory name as the argument of the "mkdir" command and execute it, but if you specify a directory that does not exist when specifying a directory over a multi-level hierarchy, an error will occur.In such a case, you can force a non-existent directory to be created and create a multi-level directory at once by executing with the option "-p".
Directory and file operations

Delete the directory (and everything in it)

Delete the directory (and everything in it)To remove a direc...
Directory and file operations

Check the number of characters and lines in a file

The wc command is used to check the number of characters and lines in a file. To check the number of characters, use "-c" as an option, and to check the number of lines, use "-l".To execute the wc command, specify the name of the file you want to investigate as an argument.
Directory and file operations

Display the contents of a file with line numbers

To display the contents of a file, use the cat command, but if you run it without options, it will simply display the contents. To display the contents of a file with line numbers, run the cat command with the option '-n'.If you don't want to add line numbers to blank lines in the file, add the option "-b".
Directory and file operations

Create an empty file (zero bytes)

To create an empty file, use the touch command, which changes the type stamp of a file, but creates a zero-byte file if the argument is a non-existent file.