In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article focuses on "testing common linux command set one", including "cd, ls, pwd, mkdir, mv" commands. For non-high frequency or willing to in-depth study can conduct a small search, hope that interested partners can keep watching and welcome to put forward valuable suggestions for us to make progress together!
Command cdcd [destination directory]
1) enter the current user's home directory: cd ~ or cd
2) enter the current directory: cd.
3) enter the root directory: cd /
4) enter the directory above: cd..
5) enter the upper two-level directory: cd.. /..
6) enter the specified directory: cd app/soft
7) Note:
Cd is mainly used to switch the current working directory to the dirName user's home directory which is the HOME directory of the current user, which is specified when adding the user. The default HOME directory for general users is / home/xxx (xxx is the user name) cd / app/soft refers to the path to enter the root directory cd app/soft refers to the path to enter this directory 02: command lsls [parameters] [path name or file name] description: print out the file parameters contained in the current working directory:-a shows all files and directories (including hidden files)-l lists the specific information of the files (permissions, owners, File size, etc.)-h lists the file size in an easy-to-understand format (e.g. 1K 256m 2G)-s prints out the block size of the file after each file-R recursively displays all files in the current directory ls-l file content display analysis the first column: file type (10 characters in total) + permissions-> man find search type visible -: ordinary file D: directory c: character device-> for example: USB interface, Some serial port devices such as cats b: block devices-- > for example: optical drive Hard drives belong to block devices.: SELINUX related l: link files-> soft links second column: the number of hard links starts from 1 by default. If it is a directory, the default is 2 (directories do not make hard links). The third column: files belong to the main fourth column: file group fifth column: file size 6 to 8: creation time / last modification time column 9: file name
1) list all subdirectories and files in the current directory: ls-R
2) list all files in the directory (including hidden files): ls-a
3) list the details of the file (including permissions, owner, file size [display KMagazine G], etc.): ls-lh
4) list the details of all files and subdirectories starting with "abc" in the current directory: ls-lR | grep abc
03: command pwd
Print the absolute path of the current directory: pwd
Command mkdirmkdir [parameter] [pathname or file name] description: used to create a directory or a cascading directory parameter:-m to create a directory at the same time set the permissions of the file (a file has three permissions: read, write, execute. The corresponding numbers are: 4, 2, 1)-p if the parent directory is not created, all directories on the input path are created
1) create a new folder a: mkdir a
2) create three new folders a b c: mkdir a b c
3) create a new multi-level folder a/b/c: mkdir-p a/b/c
4) create a new folder with read and write permissions: test: mkdir-m 777 test
Command mv mv [parameter] [source file or directory] [destination file or directory] description: rename a file or directory File or directory move to another location parameter:-I if the specified directory already has a file with the same name, first ask whether to overwrite the old file-f force (force) to overwrite the existing target file without giving any indication-b if you need to overwrite the file, first backup-t specify the target directory of the mv. This option is suitable for moving multiple source files to a directory. At this point, the destination directory is before the source file runs in the later command format, the result mv file name is changed to the source file name, the mv file name, the directory name, the file is moved to the destination directory, the mv directory name, the directory name, the destination directory already exists, the source directory is moved to the destination directory Error renaming mv directory name file name if the destination directory does not exist
1) rename a to b or move a to b: mv a b
① if the target file / directory b does not exist, it means to rename a to b
② if the target directory b already exists, it means to move a to the b folder
2) move a folder to the specified directory (1 folder is moved to the a _ mv b directory): move a folder to a _ b (error will be reported if 1 file already exists in b)
3) move the current file a to the / app/soft directory and rename it b: mv an app/soft/b
4) move file a to the parent directory: mv a.. /
5) move two files to the specified directory simultaneously: mv a b-t app/soft or mv-t. / app/soft a b
6) back up the file before overwriting: mv-b 1.txt 2.txt
7) before moving a file with the same name, ask if you want to overwrite the file: mv-I 1.txt app/soft
8) move all the contents under the current folder to a higher-level directory: mv *.. /
9) move all txt files in the current directory to another directory: mv. / * .txt isTester/
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.