In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how to use the Linux command to open a file in the terminal". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
In Linux systems, it's easy to open a file as long as you have a startup icon, but how do you open a file under a terminal without a startup icon? The use of commands can solve this problem. The following editor will teach you how to use commands to open files in the Linux terminal. Let's learn together.
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.
Some information of xdg-open manual is attached:
Xdg-open opens a file or URL in the user's preferred application. If a URL is provided the URL will be opened in the user's preferred web browser. If a file is provided the file will be opened in the preferred application for files of that type. Xdg-open supports file, ftp, http and https URLs.
Xdg-open is for use inside a desktop session only. It is not recommended to use xdg-open as root.
"how to use the Linux command to open a file in the terminal" content is introduced here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.