Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do I open a file from a terminal ? When I try to open a simple txt file like :

 open _b2rR6eU9jJ.txt

I get this message :

Couldn't get a file descriptor referring to the console

Is that command a wrong one ? Is it that to open files of different type we have modified commands ?

share|improve this question
1  
What do you mean by opening it? Do you want to edit it? You can use nano, emacs or vi for that. –  artistoex Sep 21 '12 at 7:39

3 Answers 3

up vote 1 down vote accepted

You must use an editor to open a text file:

Any of those can do it:

 - vi _b2rR6eU9jJ.txt
 - vim _b2rR6eU9jJ.txt
 - emacs _b2rR6eU9jJ.txt
 - nano _b2rR6eU9jJ.txt
 - gedit _b2rR6eU9jJ.txt (gnome's default editor)
 - leafpad _b2rR6eU9jJ.txt (lxde's default editor)
 - kedit _b2rR6eU9jJ.txt (KDE's default editor)

Or if you wanted to just view the file without modifying its contents: cat _b2rR6eU9jJ.txt

EDIT #1: I just noticed that the question is tagged fedora, which up until now is using gnome as its core graphical user interface, which comes with gedit preinstalled. So this is guaranteed to work: gedit _b2rR6eU9jJ.txt

share|improve this answer

You can use xdg-open to open files in a terminal.

From the man-page of xdg-open:

xdg-open - opens a file or URL in the user's preferred application

Usage

The command xdg-open _b2rR6eU9jJ.txt will open the text file in a text editor that is set to handle text files. The command will also work with other common file extensions, opening the file with the relevant application.

See also:

share|improve this answer

You should use an appropriate application to open it - try nano _b2rR6eU9jJ.txt or cat _b2rR6eU9jJ.txt. The former will edit, the latter will output it to standard output. (Note - you can replace nano with vi, emacs or other text editor of your preference)

From what I can tell

geek@ubuntu:~$ open --help
open: invalid option -- '-'
Usage: openvt [-c vtnumber] [-f] [-l] [-u] [-s] [-v] [-w] -- command_line

open refers to openvt - and the man page describes it as openvt - start a program on a new virtual terminal (VT). You're trying to open a text file, so unless I'm missing something, it isn't the software for doing what you want to do.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.