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--
This paper gives an example of linux file management command. Share with you for your reference, the details are as follows:
1. File permissions
Read r 4
Write w 2
Run x 1
Files are divided into three types of permissions:
User permissions within the owner permissions group and outside the group
2. View the files in the directory
Ls [option] [path or file name]
-l: view details
-a: view all files, including hidden files
First column: file permissions
-(rw-) (-)
The first character indicates the file type (- for ordinary files, d for folders)
The second one represents owner permissions.
The third indicates the group permissions to which he belongs.
The fourth indicates the permission outside the group.
Second column: number of file nodes
Third column: file owner
Fourth column: the group to which the file belongs
Fifth column: file size
Column 6: the last modification time of the file
Seventh column: file name
3. Directory management
Mkdir directory name create directory
-p Recursive creation
-m specify permissions when creating directories (linux default permissions for creating directories are 755)
Rmdir directory name delete directories (only empty directories can be deleted)
-p Recursive deletion
4. File creation and deletion
Touch filename creation file
Rm filename Delete Files (will prompt for deletion)
-r Recursive deletion
-f indicates shutdown confirmation
5. Copy and move files
Cp [option] Source file path destination file path copy file
-R: recursive replication
-p: keep the original attributes of the file during replication
-v: displays the replication process
> cp-R / home/user1/123 / home/. (. Indicates the use of the original file name)
Mv [options] Source file path destination file path move file
-v: display proc
> mv / home/user1/123 / home/.
* mv can also be renamed.
6. Document statistics
Wc [options] File list Statistics File content
-c statistics on the number of characters
-l count the number of rows
-w count the number of words
> wc-c 1.txt > wc-w 1.txt
7. Search for matching lines
Grep [options] string source file
-n display line number
-c how many lines are matched
-I ignore case
> grep-ni hello 1.txt
I hope what is described in this article will be helpful to the maintenance of Linux system.
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.