Batch processing command teaching pipe symbol (|) _dos/bat

Source: Internet
Author: User

The function of the pipe character (|) is to output the process before the symbol as input to the process after the symbol.

For example:
There are two commands, "dir/s/b/a" and "find". txt ", the first shows all the files and folders in the current folder, and the second is to look for a string containing the character". txt ".

Two commands you can "find all files, folders in the current folder that contain. txt" by using a pipe character (|) connection.

Copy Code code as follows:

DIR/S/b/a | Find ". txt"

Some cases require a pipe character (|):

1. Place the current date on the Clipboard.

Copy Code code as follows:

Echo%date:~,10%|clip

2. Find a specific string or file or folder

This feature is perfect to achieve, need to be familiar with mastering findstr and for, and the pipe character (|) is indispensable when findstr and for are used at the same time.

Copy Code code as follows:

CLIP
Describe:
Redirects the output of the command-line tool to the Windows Clipboard. This text output can be pasted
to another program.

Parameter list:
/? Displays this help message.

Example:
DIR | CLIP a copy of the current directory list into the Windows clipboard.

CLIP < README. TXT places a copy of Readme.txt into the Windows clipboard.

The above mentioned is the entire content of this article, I hope to be able to master batch processing commands to help.

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.