In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Experimental environment: centos7, xshell6
1. Classification and format of Linux commands
Generally speaking, Linux commands can be divided into two categories, one is internal commands, the other is external commands.
Internal command: refers to some special instructions integrated with the Shell interpreter program, also known as built-in instructions. Internal commands are part of Shell, so there is no separate corresponding system file. As long as the Shell interpreter program is run, the internal instructions are automatically loaded into memory, and users can use them directly. Internal commands do not need to read files from the hard disk, so they are executed more efficiently.
External command: refers to the script file or binary program in the Linux system that can perform specific functions. Each external command corresponds to a file in the system, which belongs to a command outside the Shell interpreter program, so it is called an external command. The Linux system must know the location of the file corresponding to the external command before it can be loaded and completed by Shell.
Format of the Linux command line
Command word: the command word is the name of the command, which is the most critical part of the whole command.
Options: the function of the option is to adjust the specific function of the command and determine how the command is executed.
Parameters: command parameters are the processing objects of the command word, usually the file name, directory name or user name of the command parameter.
Among them, command words, options, and parameters are separated by spaces, and extra spaces will be ignored. The options and parameters in the command line can be omitted in some cases, that is, the command line can only have command words, or only command words, options, or only command words and parameters.
2. Linux command practice
The following picture shows the xshell login interface, which means as shown in the figure.
If the ID is $, it is an ordinary user.
(1) hostname
The hostname command can view the full name of the current host, or it can be used to modify the hostname of the current system.
When viewing the hostname, enter the command hostname directly
When you modify the hostname, enter the hostname you want to change after the command
(2) pwg
The pwg command is used to display the location of the user's current working directory, which is the default location starting point for the user to manipulate files or other subdirectories. Use the pwg command to add no options and or parameters.
(3) cd
The cd command is used to change the user's working directory to another location, which usually requires switching to the target location as a title.
Cd returns the host directory, the home directory
Cd.. Return to the previous directory
Cd.. / return to the upper directory
Cd / returns the root directory
Cd-two paths switch back and forth
(4) ls
The ls command is mainly used to display the contents of the directory, including the relevant attribute information of subdirectories and files. The parameters used can be either a directory name or a file name, allowing multiple parameters to be used simultaneously in the same command.
In character mode, different files are distinguished by color, dark blue indicates directory, white indicates general file, green indicates executable file, × × represents device file, and red indicates compressed file.
Execute the ls command without any options and parameters to display the subdirectories and file list information contained in the current directory.
Ls-a
Displays all directory and file information, including "." Hidden directories and hidden files at the beginning
Ls-s
Displays details, that is, a single file size
Ls-lh
Displays the total directory size and individual file size
(5)\
Line break display, note that line breaks and no spaces are allowed in front of them.
In the following figure, the path is the abrt file in the etc directory, and you can enter it in a new line.
(6) du
The du command can be used to count the amount of disk space occupied by a directory. Use the name of the directory or file as the parameter. The du command is optional as follows
Count the size of the boot directory
Du-a
Du-s
Du-ah
Du-sh
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.