Question regarding terminal in GNOME

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
DynamicBison

Question regarding terminal in GNOME

Post by DynamicBison »

I started using Linux Mint (GNOME) about a month ago, and I think it's awesome.

Coming from Windows, Linux Mint will definitely take some time to get use to, but I am having fun along the way. I'm trying to use terminal as much as possible, and I have one question. Let's say I save file foobar with OpenOffice. If I try to open foobar in terminal using gnome-open or xdg-open, it will open up in OpenOffice, right? No problems there. However, what if I want to open it in gedit? I know I could easily do this using Nautilus but is there a way to do this in terminal as well?

Any help would be greatly appreciated.

-DB
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
randomizer

Re: Question regarding terminal in GNOME

Post by randomizer »

You simply call the application you want to open it with and pass the filename (and path if it's not in the current working directory) to the application as an argument.

Code: Select all

gedit path/to/file
Done :D Of course you must ensure you use "sudo" where appropriate or the file will be readonly. Also, if you use ctrl+c in the same Terminal tab it will force kill the application and you will use any unsaved data.
zengeek

Re: Question regarding terminal in GNOME

Post by zengeek »

Dammit,
Thats the one thing i DO know how to do.
I totally wanted to help someone...

Oh, well, next time...

PS. you can also open muliple files with the one command

gedit text1.txt text2.txt

you can probably do it with full path as well if you're not in the right directory.
User avatar
eiver
Level 5
Level 5
Posts: 568
Joined: Fri Jan 23, 2009 5:51 am

Re: Question regarding terminal in GNOME

Post by eiver »

Or if you are already in the same directory as the file, you can skip the path and write just the file as argument (gedit foobar.odt)
Of course you will see that gedit fails to display open office files, bacause it was designed to open plain text files only - it doesn't know which encoding to use. To open ANY file and see its contents you can use for example Bless hex editor (which can be installed through Software Manager or Synaptic).
DynamicBison

Re: Question regarding terminal in GNOME

Post by DynamicBison »

Thank you for your quick replies everyone! I've learned a lot.
Locked

Return to “Beginner Questions”