Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the xclip command in Linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to use the xclip command in Linux, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand.

The common Linux command xclip command establishes the channel between the terminal and the clipboard, which can be used to save the terminal output or the contents of the file to the clipboard in the way of the command, or to output the contents of the clipboard to the terminal or file.

Xclip Management X pasteboard

Add that in the X system, there are two mechanisms for copying text from one window to another, namely Selections and cut buffers.

The commonly used copy & paste uses the cut buffers mechanism; in addition, using the mouse to select a paragraph of text, and then pressing the middle mouse button in another window to copy, using the selections mechanism. Selection can be divided into master and slave selection.

When a file is selected with the mouse, the text is automatically copied to master selection. Then press the middle mouse button in another place and paste the contents of the master selection automatically.

Both methods are convenient when you want to copy a small amount of text. But it's troublesome when copying large chunks of text. In addition, you may do some copy-and-paste work frequently, constantly selecting the text with the mouse, and then pasting. This is the torture of the opponent's fingers.

I couldn't stand the torture, so I found xclip, a convenient tool for managing the contents of X selections.

For example, the following command copies the contents of the file / etc/passwd to X master selections.

Xclip-I / etc/passwd can then be copied elsewhere, using the middle mouse button. Or a more comfortable shift+insert. My most common method now is to manage the content of X master selections through keyboard binding. For example, alt+F1 can copy the contents of my ~ / F1 to X master selections,alt+F2 ~ / f2. In this way, you can easily copy and paste the content you need to use frequently. Like a common password or something.

Thank you for reading this article carefully. I hope the article "how to use xclip commands in Linux" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report