Shell notes: Moving files

Source: Internet
Author: User

1. Write a shell script to transfer files larger than 10K in the current directory to the TMP folder in the current directory

#/bin/sh #Programm: 1.sh # Using for move currently directory to/tmp #首先一定要注意, the symbol behind the in is not a single quotation mark, but the ~ key below the symbol #!/^d/represents the current folder file, do not Move, that is, the line that begins with D #!/.sh$/end is. sh files do not move, script files are also in this directory, do not move oh for FileName in ' ls-l | awk '!/^d/&& $5>10240 &&!/.sh$/{print $9 ' \ n '} ' do# not necessarily TMP, any path can be OH MV $FileName tmp done Ls-al TM P echo "done!"

Shell notes: Moving files

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.