Skip to main content

Questions tagged [file-opening]

How to open files in the desired application.

4 votes
2 answers
1k views

How do I open a file at specific line in a running emacs?

emacs can be run from the command line to open a file at line n with a +n command line argument like so : $ emacs +n file I'd like to do the same from a running emacs instance, either via find-file ...
ychaouche's user avatar
  • 1,033
1 vote
1 answer
377 views

How to set Open File Dialog path explicitly?

Description I'd like to point a folder so any application will start its "File Open Dialog" in it. How can I do that? Rationale I'm naturally using many applications while working on a ...
ceremcem's user avatar
  • 2,461
3 votes
4 answers
2k views

Open any .c file with Sublime Text using a terminal command

The IDE that I use is Sublime Text 3. If I want to open a file through a terminal with Sublime Text, I have to type: subl <file>.c I want to edit my .bashrc so that any .c file automatically ...
K Split X's user avatar
  • 1,823
1 vote
1 answer
267 views

Canonical way to simulate a file manager "open item" from the command line

Almost every desktop environment has a mechanism for determining what to do when you (double)-click a file in file manager/explorer windows. This can be based on the extension, or on whatever file ...
einpoklum's user avatar
  • 11k
3 votes
1 answer
10k views

Launch executable with xdg-open

I am trying to write a function launchSystemFile which works like windows ShellExecuteEx from the command line or from C++. If I ShellExecuteEx a blah.txt it opens it in the default editor. If I ...
Noitidart's user avatar
  • 307
1 vote
1 answer
593 views

How to automatically open terminal window when I click a script?

My Python script has an interpreter in a first line. The file is executable. Is it possible that I click on my script and the terminal windows opens, executes the script and stays open? Right now, ...
Hrvoje T's user avatar
  • 1,037
2 votes
1 answer
2k views

What is the selected application for XFCE's exo-open?

Under XFCE, xdg-open calls exo-open. When exo-open is called with --launch is uses the application set with xfce4-settings-manager. However, when one calls exo-open foo.txt (local path, without --...
Martin Monperrus's user avatar
1 vote
0 answers
789 views

Universal file association file

I am using multiple desktops / windows managers (KDE, Openbox wm, and i3 wm ) on my PC and I want to establish an unified and universal file where I would set file associations for my whole system. ...
71GA's user avatar
  • 1,296
3 votes
1 answer
459 views

Can I add the Twig file type to Linux?

I generally give Twig files a "twig" extension. As I understand it these Twig files are usually recognised as HTML like files by Linux using some sort of scan algorithm. So Nemo for example ...
gornvix's user avatar
  • 483
6 votes
1 answer
1k views

What program to use to open files? (gnome-open, gvfs-open, xdg-open, etc.)

I have a Java program that runs on Linux, and from within the program, I want to open files (e.g. PDF files) with the system's native viewer. There are various programs available for this purpose: ...
python dude's user avatar
2 votes
1 answer
1k views

Where mimeopen saves default app config?

I associated pdf with Okular using mimeopen. Then I became curious where it had saved the configuration. My first guess was: $HOME/.config/mimeapps.list but it didn't contain the right entry. So I ...
atevm's user avatar
  • 287
1 vote
0 answers
57 views

Directory of the "open files dialog" in Kicad

I need to make an application (Kicad, in this context) launch its "Open File" dialog in current working directory (where I launched Kicad). Is there any standard environment variable for this ...
ceremcem's user avatar
  • 2,461
2 votes
1 answer
258 views

Is there any way to detect file type and open it with GUI in terminal in Fedora? [duplicate]

For example , there are two files a.ppt and b.jpg . And I can call a magic method to open them appropriately just like : magic_method a.ppt magic_method b.jpg And it open libreoffice writer and ...
KIDJourney's user avatar
2 votes
1 answer
648 views

Is there a FreeDesktop command to open an open-with dialog similar to xdg-open?

is there a (FreeDesktop) Linux command to open an "open-with" dialog similar to xdg-open? I'm searching for some general desktop environment independent solution for showing something like this: Of ...
Sebastian Wagner's user avatar
7 votes
3 answers
23k views

Why does linux use file extension to decide the default program for opening a file though it's independent of file extensions

I have a text file as- abc.text and it has its contents as Hi I'm a text file. If I double click to open this file, then the files is opened in gedit editor. Whereas, if I rename the file to abc....
Shivam Aggarwal's user avatar

15 30 50 per page