您可能不知道的5个Windows命令提示符技巧

image
()

We tend to use the command prompt quite a lot here at How-To Geek, so we decided to show you 5 tricks we use in the command prompt that you might not know–read on to find out what they are.

我们在How-To Geek上经常使用命令提示符,因此我们决定向您展示您可能不知道的在命令提示符中使用的5个技巧,请继续阅读以了解它们的含义。

将命令的输出发送到剪贴板 (Send a Command’s Output to the Clipboard)

Note: This will work for any command.

注意:这适用于任何命令。

How many times have you used the ipconfig command only to copy and paste the output?  You will never have to do that again as you can simply send the output directly to the clipboard.

您仅使用ipconfig命令复制和粘贴输出几次? 您无需再做一次,因为您只需将输出直接发送到剪贴板即可。

ipconfig | clip

ipconfig | 夹

image

从文件夹中打开命令提示符 (Open Command Prompt From a Folder)

Have you ever opened the command prompt and entered endless cd commands trying to get to a folder ? If the answer is yes then you will pleased to know that you can actually save a lot of time by opening a command prompt within a folder from Explorer. All you have to do is hold shift while right-clicking on a folder and the option will appear in the context menu.

您是否曾经打开命令提示符并输入了无尽的cd命令来尝试进入文件夹? 如果答案是肯定的,那么您将很高兴地知道,通过从资源管理器打开文件夹中的命令提示符,您实际上可以节省很多时间。 您要做的就是在右键单击一个文件夹的同时按住shift键,该选项将出现在上下文菜单中。

image

命令历史 (Command History)

You most likely have been pressing the up key to get to your previous commands, but this can be a pain when you are trying to track down a particular command. One other way you can view your past command is to use the doskey command.

您很可能一直按向上键才能找到先前的命令,但是当您尝试查找特定命令时,这可能会很痛苦。 查看过去的命令的另一种方法是使用doskey命令。

doskey /history

驴子/历史

image

拖放文件以更改当前路径 (Drag and Drop Files to Change the Current Path)

Another neat trick if you are not a fan of opening a command prompt from the context menu is the ability to drag and drop folders onto the prompt and have it automatically enter the path of the folder. You’ll need to type the CD command and then drag the folder over to actually change the path, but you can use the same technique for a lot of different commands.

如果您不喜欢从上下文菜单中打开命令提示符,则另一个巧妙的技巧是可以将文件夹拖放到提示符上,并使其自动输入文件夹的路径。 您需要键入CD命令,然后将文件夹拖到上面以实际更改路径,但是您可以对许多不同的命令使用相同的技术。

image

一口气运行多个命令 (Run Multiple Commands In One Go)

Our final trick of the day is one that many command line geeks may already know, the ability to run multiple command at once by linking them with double ampersands. You can do this with any commands and you can link up as many as you want:

我们今天的最后一招是许多命令行极客可能已经知道的技巧,即通过将它们与双“&”号链接在一起,可以立即运行多个命令。 您可以使用任何命令执行此操作,并且可以根据需要链接任意多个:

ipconfig && netstat

ipconfig && netstat

image

翻译自: https://www.howtogeek.com/119386/5-windows-command-prompt-tricks-you-probably-dont-know/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值