In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to use the find command to find hidden files in Linux". In daily operation, I believe many people have doubts about how to use the find command to find hidden files in Linux. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to use the find command to find hidden files in Linux". Next, please follow the editor to study!
We can use the find command on Linux or Unix systems to query all (all) hidden files
The basic syntax is as follows:
The code is as follows:
[root@dabu.info ~] # find / text / piece / folder /-name ". *"-print
Explanation:
1. ". *" represents the file name to look for. Because the hidden file and folder names of linux / Unix start with "." And * represents a wildcard, which means to find all file names and folder names with "." Start files and folders.
2.-print means to print the results of a search. Same function as-ls
Or
The code is as follows:
[root@dabu.info ~] # find / text / piece / folder /-name ". *"-ls
Or just search for hidden files:
The code is as follows:
[root@dabu.info ~] # find / text / piece / folder /-type f-iname ". *"-ls
Or just search for hidden folders:
The code is as follows:
[root@dabu.info ~] # find / text / piece / folder /-type d-iname ". *"-ls
Explanation:
-type: specifies the type of file to be searched, whether it is a folder or a file, etc., to be used with f or d
F: the meaning represents the document, and the document is file in English.
D: it stands for folder, and the folder is directory in English.
-iname: indicates that case is ignored when matching file names. For example, if you look for "fo*", "foo" and "fOO" will match.
Or
The code is as follows:
[root@dabu.info ~] # find / text / piece / folder /-path'* /. *'- print
[root@dabu.info ~] # find / text / piece / folder /-path'* /. *'- ls
For an explanation of the-path parameter, see another article, "explanation of the function (meaning) of the-path parameter in the find command".
In the following example, find all hidden files and folders under $HOME ($HOME is the user's home directory, which you can use (echo $HOME command to see what you mean).
The code is as follows:
[root@dabu.info ~] # find $HOME-name ". *"-ls # has been queried recursively
The output is as follows:
The code is as follows:
553607 4-rw-r--r-- 1 root root 100 Sep 22 2004. / .cshrc
6553664 4-rw- 1 root root 1024 Nov 17 04:40. / .rnd
6553604 4-rw-r--r-- 1 root root 18 May 20 2009. / .bash _ logout
6553665 4 drwx- 2 root root 4096 Dec 18 2012. / .gnupg
6553671 0-rw- 1 root root 0 Dec 18 2012. / .gnupg / secring.gpg
6553669 0-rw- 1 root root 0 Dec 18 2012. / .gnupg / pubring.gpg~
6553673 4-rw- 1 root root 899 Dec 18 2012. / .gnupg / pubring.gpg
6553667 8-rw- 1 root root 7856 Dec 18 2012. / .gnupg / gpg.conf
6553668 4-rw- 1 root root 1200 Dec 18 2012. / .gnupg / trustdb.gpg
6553602 20-rw- 1 root root 17462 Apr 7 10:55. / .bash _ history
6553610 4 drwx- 3 root root 4096 Jan 16 2013. / .config
6553660 4 drwx- 2 root root 4096 Jan 16 2013. / .config / htop
6553681 4-rw-r--r-- 1 root root 597 Apr 11 2013. / .config / htop/htoprc
6553723 12-rw- 1 root root 9629 Mar 30 23:56. / .viminfo
6553615 4 drwxr-xr-x 3 root root 4096 Nov 29 2012. /. Original-configs
To store the results in the text file foo.txt, use output redirection with the following command:
The code is as follows:
[root@dabu.info ~] # find $HOME-name ". *"-ls > foo.txt
[root@dabu.info ~] # cat foo.txt # View the contents of the foo.txt file, that is, the running result of the find command
Suppose I want to view the hidden files and folders under / home/www/ and save the results to foo.txt. Use the following command:
The code is as follows:
[root@dabu.info ~] # find / home/www/-name ". *"-ls > foo.txt
At this point, the study on "how to use the find command to find hidden files in Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.