[Linux] Linux Shell Find Files

Source: Internet
Author: User

#!/bin/bash# Find all files larger than 1MB in the current directory, write the file name to a text file, Count # # Find command, Parameters: path address, command arguments,-size n (find files of length N)-type F ( Find a type of file, F normal file) # Tee    Command | pipe symbol passes the result of the first command to the second command # WC statistics command, Parameters:-L (count rows)findteeWC -L
#!/bin/bash# Purpose: Find/directory, file name starts with ABC 100 files, save to File # # forin loop # shell command substitution, anti-quote, save command execution result to variable # Find command parameters:-name"XXX"(Find the file name, you can use the wildcard character *) # Head Start command parameter:-N (shows how many rows) # output REDIRECT>> two x >>Delegate Append forFileNameinch`Find/-name"abc*"|Head-N -` Do    Echo$filename >>Abcfile.txt Done

[Linux] Linux Shell Find Files

Related Article

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.