In a Linux system, opening a file is as simple as a startup icon, but how to open a file in the terminal without the startup icon? Using the command can solve this problem very well. The following small series teaches you how to use the command to open files in the Linux terminal. Let's learn together.
work in a Linux environment, most of the time in dealing with the terminal, often encounter To view a file, such as a picture or a word document (can not be viewed directly in the terminal ). At this time, the usual way 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 open the file by entering the specified program directly in the shell, for example: evince xx.pdf View a pdf file. Of course, the premise of this is that you have to remember the names of those programs, such as you can remember to use LibreOffice to open a word file command? Anyway, I can't remember.
A lot of default file opening methods have been defined in the graphical interface. For example, if you double-click a web page file, it will automatically open with the default browser. Double-clicking on a picture will open with the default image browser, so the terminal There should also be a corresponding mechanism. Follow this idea to go to google, and found the xdg-open command (compatible with gnome and kde), this command will use the default settings of the file in the graphical interface to open the same way (and directly double-click to open the file should be the same behavior ).
With 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 open the directory with the file manager under the graphic, such as opening the user's home directory:
xdg-open ~
A very useful tool!
The specific operation is as follows:
xdg-open { file |
URL }
xdg-open { --help |
--manual |
--version }
OK, is it more convenient now, you can open the shell with the shortcut key Ctrl+Alt+T, F11 can be displayed in full screen (Alt+F9 minimizes the window, Alt+F10 maximizes/restores The window), supplemented by the xdg-open command, greatly reduces the mouse operation and greatly improves the efficiency.
Attached to the xdg-open manual section information:
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 is a desktop session only. It is not recommended to use xdg-open as root.
The above is the method of opening a file in a Linux terminal. Using this method can reduce the mouse operation, and the file is easy to open in the terminal. A lot, is it very simple? Give it a try.
Linux system network performance can be tested with tools. The main test tools are
Ubuntu system operation, Chromium is a browser developed by Google, if you do not have Flash install
The Linux system process is composed of threads. Of course, the number of threads u
In the Linux command, the usage of the chmod command is somewhat similar to that of
What should I do if the Linux runlevel is set to 6 and then restart infinitely?
RHEL 6.0 system sudo switch user is too slow how to do?
How to check the version of Shell that Linux system is using?
How to remotely connect to the Linux system desktop via VNC
How to use Linux commands to view CPU usage
Frequently Asked Questions for Linux Servers and Firewalls
How to install and configure Vim IDE for Linux systems
Linux steps to monitor database systems with Zabbix
How to change the name of Linux multi-network card?
Linux Zsh command usage example
Let Windows 7 easily recognize video files in Real format
Win10 official version can be activated after changing the hard disk?
How to view system installation time in Win8.1
Effectively speed up the display speed of WinXP window
Win8 tile background set graphic tutorial
Kmplayer startup screen black solution
Win8 hard disk partition graphic tutorial
Beginners how to quickly learn the find command under Linux
VPS novice Linux tutorial: SSH remote management /common commands /file upload download