Linux shell Command and execution script, linuxshell

Source: Internet
Author: User
Tags linux shell commands

Linux shell Command and execution script, linuxshell

Http://blog.csdn.net/pipisorry/article/details/44681081

Cut all subfolders in the current folder to the current folder

For dir in $ (ls)
Do
# Echo $ dir
If [-d $ dir-a "$ (ls-A $ dir)"]; then
Mv./$ dir /*.
Fi
Done
Note:

1. There must be spaces between each component in [], including [-d and "]

2. Determine whether the dir file is a directory & determine whether the dir folder is empty

3. The problem is: if you do not know how to recover it, leave a message to solve it!


Run linux shell commands and script files in windows

You can use git bash (download and install git)

You can execute the sh script file in the test.

Note: Command line toolGit BashAlso integrated into Windows Resource Manager, right-click on the folder, you can clickGit Bash HereAndGit GUI HereQuickly start Git and automatically switch to the specified folder.

From: http://blog.csdn.net/pipisorry/article/details/44681081


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.