In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you in the Linux terminal how to use the default program to open files, I believe that most people do not understand, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Working in the Linux environment, I spend most of my time dealing with the terminal, and I often encounter the need to view a file, such as a picture or an word document (which cannot be viewed directly in the terminal). The usual way to do this is to switch to the gui interface, go to the directory where the file is located, and double-click the file you want to open. Another way is to enter the specified program directly into shell to open the file, such as: evince xx.pdf to view a pdf file. Of course, the premise is that you have to remember the names of those programs, such as can you remember the command to open a word file with LibreOffice? I can't remember anyway.
Many default file opening methods have been defined in the graphical interface, for example, if you double-click a web file, you will automatically open it with the default browser, and double-click an image will open it with the default picture browser. So there should be a corresponding mechanism under the terminal. Following this idea to google for a while, you will find the xdg-open command (compatible with gnome and kde), which will open the file in the same way by default as set in the graphical interface (the same as double-clicking directly to open the file).
Using this command, it is much more convenient to open a file under the terminal, such as opening a pdf file with the default pdf reader:
Xdg-open xxx.pdf
You can also use the file manager under the drawing to open the directory, such as the user's home directory:
Xdg-open ~
A very useful tool!
The specific operations are as follows:
Xdg-open {file | URL}
Xdg-open {--help |-- manual |-- version}
OK, now is not much more convenient, through the shortcut key Ctrl+Alt+T can open shell,F11 can be full-screen display (Alt+F9 minimize window, Alt+F10 maximize / restore window), and then supplemented by the xdg-open command, greatly reduce the mouse operation, but also greatly improve the efficiency.
The above is all the contents of the article "how to use the default program to open a file in the Linux terminal". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.