Use the Linux find command

Source: Internet
Author: User

Recently, I have learned a lot about Linux commands, such as using vim, find, and RPM to package spec configuration files.

The basic edition of laruence private room has helped me a lot. Here, I would like to thank laruence.

One of the problems encountered was to use ubuntu12.04 to upload a directory to the company's SVN, but this directory was previously downloaded from SVN. After changing the directory, You need to delete all the original. SVN directories. I went online and found out how to delete all. SVN files in the directory in Linux. The method is as follows:

In Linux, it is very easy to delete these directories, mainly using the find tool. The command is as follows:
Find.-type D-name ". SVN" | xargs Rm-RF
Or
Find.-type D-INAME ". SVN"-exec Rm-RF {}\;

It seems that the subersion client in Linux is quite fast. It takes more than 10 minutes to download the 5.8g directory to the local device, but it takes at least half an hour to download it using Windows SVN.

Sometimes you may need to search for files with certain characteristics in the system (such as file permissions, file owner, file length,
File type ). There may be many reasons for doing so. This may be due to security considerations or general system management tasks.
To find a file that does not know where it is stored. F I n d is a very effective tool, it can
To traverse the current directory or even the entire file system to find some files or directories.

The general form of the f I n d command is:
Find pathname-options [-print-Exec-OK]
Let's take a look at the parameters of this command:
Pathname find command to find the directory path. For example, use "." To represent the current directory, and use "/" to represent the root directory of the system.
-The print find command outputs matching files to the standard output.
-The exec find command executes the s h e l command given by this parameter on the matching file. The command format is 'c o m-
And '{}\;, note the spaces between {} And.
-OK has the same role as-e x e c, but executes the S H e l command given by this parameter in a safer mode,
Before executing each command, a prompt is displayed, asking the user to determine whether to execute the command.

Can be used in a terminalMan findTo query the relevant parameters of the find command.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.