In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "what are the Linux command formats". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Command prompt
When we log in to the server, we will see the following:
[root@localhost ~] #
What does that mean? This is the Linux command prompt. The following describes common command prompts and their meanings
[]: this is the separator of the prompt and has no special meaning.
Root: shows the current logged in user.
@: a separator with no special meaning.
Localhost: the abbreviated hostname of the current system (the full hostname is localhost.localdomain).
~: represents the directory where the user is currently located. In this case, the directory where the user is currently located is the home directory.
The home directory of the superuser: / root.
The home directory of the normal user: / home/ username.
#: command prompt, which is used by Linux to identify the level of user permissions logged in. If you are a superuser, the prompt is #; if you are a normal user, the prompt is $.
Since users have full permissions in their own home directory, it is recommended that you switch to the home directory to operate:
[root@localhost ~] # cd / usr/local
[root@localhost local] #
Note: if you switch the user's directory, the command prompt will become the last directory of the user's current directory local
Basic format of Linuxm command
The basic format of the command:
[root@localhost ~] # command [options] [parameters]
The [] in the command format represents optional, meaning that some commands can be executed without writing options or parameters. So, let's use the most common ls command in Linux to explain the format of the command. If classified according to the command, then the ls command should belong to the directory operation command.
[root@localhost ~] # lsanaconda-ks.cfg install.log install.log.syslog
The role of option
The ls command can be executed without options and arguments, but only the most basic function is to display the file name in the current directory.
[root@localhost ~] # Is-l
Total dosage 44
-rw-.1 root root 1207 January 14 18:18 anaconda-ks.cfg
-rw-r--r--.1 root root 24772 January 14 18:17 install.log
-rw-r--r--.1 root root 7690 January 14 18:17 install.log.syslog
In the above code, if you add a "- l" option, you can see that the content displayed has increased significantly. "- l" means long list, that is, to display the details of the file.
The options for Linux are divided into short format (- l) and long format (--all). The short format option is abbreviated in English and is called with a minus sign, for example:
[root@localhost ~] # ls-l
The long format option is a complete word in English and is usually called with two minus signs, such as:
[root@localhost] # ls-- all
In general, the short format option is an abbreviation for the long format option, that is, a short format option will have a corresponding long format option. Of course, there are exceptions, such as the short format option-l of the ls command, which has no corresponding long format option.
The role of parameters
Parameters are the operation objects of commands, and general files, directories, users and processes can be ordered to operate as parameters. For example:
[root@localhost ~] # ls-l anaconda-ks.cfg
-rw-.1 root root 1207 January 14 18:18 anaconda-ks.cfg
Commands generally need to add parameters to specify who the object of the command operation is. If parameters can be omitted, there are generally default parameters. For example:
[root@localhost ~] # ls
Anaconda-ks.cfg install.log install.log.syslog
No arguments are specified after this ls command, and the default parameter is the current location, so the file name in the current directory is displayed.
This is the end of the content of "what Linux command formats". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.