博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
js复制文本到剪贴板_如何将输出文本从命令行复制到Windows剪贴板
阅读量:2510 次
发布时间:2019-05-11

本文共 1996 字,大约阅读时间需要 6 分钟。

js复制文本到剪贴板

js复制文本到剪贴板

If you’re doing work at the command line on your Windows box, it’s sometimes useful to copy the output of a command to the clipboard, but who wants to try and ? Here’s how to do it the easy way.

如果要在Windows框上的命令行中进行工作,将命令的输出复制到剪贴板有时会很有用,但是谁想尝试 ? 这是简单的方法。

Note: For the purposes of our exercise, we’ll be using the built-in clip utility in Windows 7 or Vista—if you are using Windows XP, you can , just make sure to save the file in the Windows directory.

注意:为了便于练习,我们将在Windows 7或Vista中使用内置的clip实用程序-如果您使用的是Windows XP,则可以 ,只需确保将文件保存在Windows目录。

将输出从命令行应用程序复制到剪贴板 (Copy Output from Command Line Applications to the Clipboard)

To copy text from a command to the clipboard, we’ll just pipe it into the clip command, like this:

要将文本从命令复制到剪贴板,我们只需将其通过管道传递到clip命令,如下所示:

<command> | clip

<命令> | 夹

For example, if you wanted to output from the echo command into the clipboard, you could do this:

例如,如果要从echo命令输出到剪贴板,可以执行以下操作:

image

You can also use redirection to send a text file directly into the clip utility, like this:

您还可以使用重定向将文本文件直接发送到clip实用程序,如下所示:

clip < filename.txt

剪辑<filename.txt

In this example I’m gonna put the contents of the single.php file onto the clipboard:

在这个例子中,我将把single.php文件的内容放到剪贴板上:

image

Of course, you could also use the type command and then pipe it to the clipboard like so:

当然,您也可以使用type命令,然后将其通过管道传输到剪贴板,如下所示:

image

Regardless of the one you use, you’ll then be able to paste the content into any other application that you’d like:

无论使用哪种软件,都可以将内容粘贴到您想要的任何其他应用程序中:

image

创建上下文菜单助手以将文件内容复制到剪贴板 (Create a Context Menu Helper to Copy File Contents to the Clipboard)

image

You can take the clip utility a step further by adding a context menu item that lets you copy the contents of any file directly to the clipboard. All you’ll need to do is follow the instructions in the following article, or download the reghack file.

通过添加上下文菜单项,可以使clip实用程序更进一步,使您可以将任何文件的内容直接复制到剪贴板。 您所需要做的就是按照下一篇文章中的说明进行操作,或者下载reghack文件。

And of course, don’t forget that you can always .

当然,不要忘记,您始终可以 。

翻译自:

js复制文本到剪贴板

转载地址:http://xbuwd.baihongyu.com/

你可能感兴趣的文章
文件转码重写到其他文件
查看>>
场景3 Data Management
查看>>
树结构练习——排序二叉树的中序遍历
查看>>
AC自动机模板
查看>>
python 基本语法
查看>>
Swift - 点击箭头旋转
查看>>
git配置
查看>>
【hexo】01安装
查看>>
CI框架源码学习笔记2——Common.php
查看>>
005---书籍添加和编辑的提交数据
查看>>
使用case语句给字体改变颜色
查看>>
JAVA基础-多线程
查看>>
面试题5:字符串替换空格
查看>>
JSP九大内置对象及四个作用域
查看>>
ConnectionString 属性尚未初始化
查看>>
数据结构-栈 C和C++的实现
查看>>
MySQL基本命令和常用数据库对象
查看>>
poj 1222 EXTENDED LIGHTS OUT(位运算+枚举)
查看>>
进程和线程概念及原理
查看>>
Lucene、ES好文章
查看>>