Windows: How to specify multiline command on command prompt?

后端 未结 4 741
Happy的楠姐
Happy的楠姐 2020-11-28 22:47

how do we extend a command to next line?

basically whats the windows alternative for linux\'s

ls -l \\
/usr/

here we use backslash

4条回答
  •  天涯浪人
    2020-11-28 23:21

    In the Windows Command Prompt the ^ is used to escape the next character on the command line. (Like \ is used in strings.) Characters that need to be used in the command line as they are should have a ^ prefixed to them, hence that's why it works for the newline.

    For reference the characters that need escaping (if specified as command arguments and not within quotes) are: &|()

    So the equivalent of your linux example would be (the More? being a prompt):

    C:\> dir ^
    More? C:\Windows
    

提交回复
热议问题