In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
one。
Display date: date
Display format: date +% Y/%m/%d date +% HRV% M
Calendar instruction: cal
Calculator: bc displays a few decimal places: scale=number exit calculator: quit
2. [Tab] hotkey: double-click on the commands that start with gr when entering the gr command, and double-click on the files that start with gr. In the numbers after the man page description, 1 represents the general account available instructions, 8 represents the instructions commonly used by system administrators, and 5 represents the system configuration file.
4. Shutdown: shutdown [- krhc] [time] 'Information'
Options and parameters:
K: it's not really turning off, it's just sending a warning message!
-r: restart after stopping the service of the system (commonly used)
-h: shut down immediately after stopping the service of the system. (commonly used)
-c: cancel the contents of the shutdown instruction that is already in progress.
5. Query the current host online personnel: who
The instruction to write data synchronously to the hard disk: sync (execute it before shutting down to form a good habit)
II. File permissions and directory configuration of Linux
1. Users are recorded in the / etc/passwd file
The password is recorded in the / etc/shadow file
The group name is recorded in the / etc/group file
two。 Change the group to which the file belongs: chgrp [- R] dirname/filename
Options and parameters:
-R: recursive (recursive) continuous changes, that is, together with all files and directories in the subdirectory
Are updated to become this group. It is often used to change all files in a directory.
Change the file ownership: chown [- R] account name file or directory
Chown [- R] account name: group name, file or directory
Options and parameters:
-R: make recursive (recursive) continuous changes, that is, all files in the subdirectory are changed
Change file permissions: chmod [- R] xyz file or directory
Options and parameters:
Xyz: the permission attribute of the numeric type just mentioned, which is the sum of the values of the rwx attribute.
-R: make continuous recursive changes, that is, all files in the subdirectory will change.
3. Permissions for the file:
R (read): you can read the actual contents of this file, such as reading the text contents of a text file, etc.
W (write): you can edit, add, or modify the contents of the file (but not delete the file)
X (eXecute): this file has permissions that can be executed by the system.
Permissions for the directory:
WRO create new files and directories
O Delete existing files and directories (regardless of the permissions of the file!)
O rename an existing file or directory
O move the files and directory locations in the directory.
X: stands for access to the directory (can be thought of as the key to the drawer)
III. Linux directory and file management
1. Create a new directory: mkdir [- mp] directory name
Options and parameters:
-m: the permissions of the configuration file! Set it directly. You don't need to look at the face of the preset permission (umask).
-p: help you directly set up the desired directory (including the upper directory) recursively!
two。 Delete directory: rmdir or rm
View of files and directories: ls [- aAdfFhilnrRSt] file name or directory name..
Ls [--color= {never,auto,always}] file name or directory name..
Ls [--full-time] file name or directory name..
Options and parameters:
-a: all files, along with hidden files (beginning with. Listed together (commonly used)
-A: all the documents, including hidden files, but not included. With; with. These two directories
-d: list only the directory itself, not the file data in the directory (commonly used)
-f: list the results directly without sorting (ls presupposes to sort by file name!)
-F: give additional data structures based on files, directories, etc., such as:
*: represents executable file; /: represents directory; =: represents socket file; |: represents FIFO file
-h: list the file capacity in ways that are easier for humans to read (such as GB, KB, etc.)
-I: list the inode number. The meaning of inode will be described in the next chapter.
-l: serial output of long data, including file attributes, permissions and other data; (commonly used)
-n: list UID and GID instead of user and group names (UID and GID will be mentioned in account management!)
-r: output the sort result in reverse, for example, the original file name is from small to large, and the reverse is from large to small.
-R: if it is listed together with the contents of the subdirectory, all the files in that directory will be displayed.
-S: sort by file capacity size, not by file name
-t: sort by time, not by file name.
-- color=never: do not give color display based on file properties
-- color=always: display color
-- color=auto: let the system decide whether or not to give color according to the setting.
-- full-time: output in full time mode (including year, month, day, hour, minute)
-- time= {atime,ctime}: output access time or change permission attribute time (ctime)
Instead of content change time (modification time) copy file or directory: cp [- adfilprsu] source file (source) destination file (destination)
Cp [options] source1 source2 source3.... Directory
Options and parameters:
-a: equivalent to-dr-- preserve=all. As for dr, please refer to the following instructions; (commonly used)
-d: if the source file is an attribute of the linked file (link file), copy the linked file attribute instead of the file itself
-f: for force, if the target file already exists and cannot be opened, remove it and try again
-I: if the target file (destination) already exists, the action will be asked first when overwriting (commonly used)
-l: link file creation for hard link instead of copying the file itself
-p: copy it along with the file's attributes (permissions, user, time) instead of using the default attributes (commonly used for backup)
-r: recursive continuous replication for directory replication behavior; (commonly used)
-s: copy as a symbolic link file (symbolic link), that is, a "shortcut" file
-u: destination updates destination only when it is older than source, or replicates only if destination does not exist.
-- preserve=all: in addition to the permission-related parameters of-p, the attributes of SELinux are also added, and links, xattr and other attributes are also copied.
Finally, it should be noted that if there are more than two source files, the last destination file must be a "directory"! Remove a file or directory: rm [- fir] file or directory
Options and parameters:
-f: it means force. Ignore files that do not exist and there will be no warning messages.
-I: interactive mode, which asks the user whether to act before deleting it.
-r: delete it recursively! Most commonly used in the deletion of the directory! This is a very dangerous option! Move files and directories, or rename: mv [- fiu] source destination
Mv [options] source1 source2 source3.... Directory
Options and parameters:
-f: force force means that if the target file already exists, it will be overwritten without being asked.
-I: if the target file (destination) already exists, it will be asked whether to overwrite it!
-u: if the target file already exists and the source is relatively new, it will only be updated (update) to view the file content directly: cat [- AbEnTv]
Options and parameters:
-A: the equivalent of-vET's integration option, which lists some special characters instead of white space
-b: list the line number, display the line number only for non-blank lines, and the blank lines are not marked with line numbers!
-E: displays the line break character $at the end
-n: print the line number, along with a blank line, which is different from the option of-b
-T: display the [tab] button as ^ I
-v: list some invisible special characters that are not plain text: od [- t TYPE] file
Options or parameters:
-t: various "TYPE" outputs can be followed by, for example:
A: use default characters to output
C: use ASCII characters to output
D [size]: use decimal (decimal) to output data, each integer occupies size bytes
F [size]: use floating point numbers (floating) to output data, each number occupies size bytes
O [size]: use octal (octal) to output data, each integer occupies size bytes
X [size]: use hexadecimal (hexadecimal) to output data, each integer occupies size bytes; modify file time or build new file: touch [- acdmt] file
Options and parameters:
-a: revise access time only
-c: only the time when the file was modified, and no new file will be created if the file does not exist
-d: you can follow the date you want to revise instead of the current date, or you can use-- date= "date or time"
-m: modify only mtime
-t: you can follow the time you want to revise instead of the current time, in the format of [YYYYMMDDhhmm]
10. Access default permissions: umask (or umask-S)
Modify default permissions: umask number (eg:022 (permissions to be removed)) configuration file hidden properties: chattr [+-=] [ASacdistu] file or directory name
Options and parameters:: add a special parameter, other existing parameters will not be changed. Remove a special parameter, while the other existing parameters remain unchanged.
=: set a certain amount, and only have the following parameters
A: when an is set, this file can only add data, but cannot delete or modify data. Only root can set this property.
I: this I is very good! He can make a file "cannot be deleted, renamed, set links, cannot write or add data!" "it is of considerable help to system security! Only root can set this property
Note 1: the setting values of an and I are common in attribute settings, and many settings can only be set as root.
Note that the 2:xfs file system only supports AadiS
Show file hidden attributes: lsattr [- adR] file or directory
Options and parameters:
-a: show the properties of the hidden file as well
-d: if you are following a directory, only the attributes of the directory itself are listed, not the file names in the directory
-R: even the data in the same subdirectory are listed side by side!
SUID/SGID/SBIT permission setting
4 if the executor of SUID (only used in files) will have the permission of the owner (owner) of the program (premise: the executor must have x permission)
2 for SGID (available for files and directories) for files: the executor will get the support of the program group during execution.
To the directory: if the user has the permission of w in this directory (you can create a new text file), the group of the new file created by the user is the same as the group of this directory
1 is SBIT (for directories only) when a user establishes a file or directory under that directory, only himself and root have the right to delete the file
Chmod 4755 test
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.