In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Today, let's continue the rest of the order (1). The two are combined into one, which is very powerful.
Shell: converts user instructions into machine-recognized instructions (translator).
Absolute path and relative path
The absolute path starts with the root directory "/", and its directory begins with a "/" symbol; the relative path starts with the current directory (such as the etc directory in the figure), and the directory begins directly with the file directory name, without the need for the "/" symbol.
Command: su (space) user name
You can change the login user name, that is, you can switch back and forth between super admins and ordinary users.
As you can see in the following figure, the home directory of the Super Admin is in the root directory, while the home directory of the average user is in the home directory. Pwd is a command that looks at absolute paths, which is mentioned in the linux command (1).
Meaning represented by file font color black: data file green: executable file (shell script) red: compressed package blue: directory (folder) sky blue: soft link file (shortcut) pink: picture
Additional knowledge:
In the figure, the alias is set to myls for the ls-alh command, and myls can achieve the function of ls-alh. The alias set must be remembered.
Statistical catalogue and space occupancy-du
Count the amount of disk space occupied by a specified directory (or file)
Du [option] [file or directory]
1. Command: du-ah, showing the size of all files in the directory and the total space of the directory with units
two。 Command: du-sh, showing the total space of the directory with units
Note: commands a, s, h cannot all be used together, and the command functions of an and s conflict with each other. The system cannot display both the total size and each item. Be extra careful.
Create a new directory-mkdir
1. Command: mkdir abc, you can create a new directory named abc
two。 Command: mkdir 1112222333, you can create multiple new directories at a time
3. Nested create new directory: command: mkdir-p test/share/demo/, creates not only the test directory under the home directory, but also the share directory under the test directory, and the demo directory under the share directory.
Create an empty file-touch
Update the time stamp of the file
Often used to create multiple new empty files
Touch file.
1. Command touch abc.txt, that is, an empty abc.txt file is created
two。 Create multiple path empty files, separated by spaces. And pay close attention to whether the path is an absolute path or a relative path.
Create a file with content
(1) vim / host/test/share/demo/demo03.txt
After entering the command, edit it in the file as shown below, and save the exit (not saving the exit file is equivalent to not creating it, and cannot be found in the directory)
(2) echo "this is demo02" > / home/test/share/demo/demo02.tx
Create a linked file-ln
Create a linked file for a file or directory, similar to a shortcut to a Windows system.
(1) soft links
Format: ln-s (file) (soft link)
Delete the source file, the link can not be opened, showing that there is no file. After you create another file with the same name for it, the link can be opened, but the contents of the created file are displayed.
The link is not available after the source file is moved to a different directory. And changing the name will also cause the link to be unavailable.
(2) hard link
Format: ln (file) (hard link)
Delete the source file, the link can be opened, and the contents can be viewed.
The hard link is equivalent to an alias for the source file, and the deletion only removes the alias.
The serial numbers of the source file and the hard link are the same.
Move Files-mv
Format: mv (source file directory location) (destination file or directory)
Transfers the specified file or directory to a location
If the source and destination files have the same address, the move command is equivalent to renaming.
Copy files-cp
Command format: cp (source file address) (destination file address)
Copy the source file and the contents to the destination address together
Leave the original permissions unchanged and copy the file under the destination address: format: cp-p (source file address) (destination file address).
Delete the specified file or directory-rm
Rm (option) Files or directories to delete
Option:-f (delete directly, no prompt)
-I (prompt before deletion)
-r (files and shortcuts are deleted together)
Environment variable
Output the environment variable command: echo $PATH. Display command files in the system
The usr/sbin file is a command for the administrator to operate.
The usr/bin file is a command that all users can manipulate.
1.which is used to find external command files:
two。 Find is used for directories or files:
In the picture, "+" means beyond, and-an is a union (if-o, it is an intersection). The command means: look in the boot directory for a size greater than 1024K and start with a name of vmlin.. Donovan's file.
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.