Skip to content

How to fix the “Couldn’t find a file descriptor referring to the console” error?

One of Linux’s best qualities is the super-powerful terminal that lets users do just about anything with a few keystrokes. That said, you have to get acclimatised to all the different commands you’ll be using, which can be a bit of a challenge for newcomers. 

In this article, we’re looking at the “couldn’t find a file descriptor referring to the console” error in the Linux terminal and telling you how to fix the problem.

Also read: What is Megapersonal error 701? 6 Fixes


Opening files correctly on Linux

Many new Linux users, especially those switching over from macOS, tend to use the open command to open files. The open command doesn’t work the same on Linux as on macOS. On Linux, the command is simply an alias for openvt, used to open virtual terminals. 

Instead, you should check if you’re using the right command to open the file. Depending on the type of file you’re trying to open, you can use either xdg-open, cat, or even nano.

The xdg-open command is used to open a file or URL in the default application registered for that particular file type or, in the case of a URL, the default web browser. For example, if you were to open an image file, the command using xdg-open would look like this

xdg-open /home/Pictures/image-1.jpg
How to fix the "Couldn't find a file descriptor referring to the console" error?

Images can also be opened using Shotwell, a digital photo organiser made for the Gnome desktop environment. It supports JPEG, PNG, TIFF, BMP, GIF, WebP and RAW photo files. 

Text files, regardless of format, can be opened using cat or nano. The format will remain the same.

cat /home/Documents/file1.txt
How to fix the "Couldn't find a file descriptor referring to the console" error?

Additionally, since nano is a text editor, you can use it to create and edit a file at the same time. Keep in mind that cat will only show the contents of a file; if you’re looking to change something, you will have to use nano or some other text editor like vim. 

Last but not least, there’s Evince, a document viewer application for Gnome environments. It supports PDF, Postscript, djvu, tiff, dvi and XPS file types among others. The syntax remains the same

evince /home/Documents/file1.pdf
How to fix the "Couldn't find a file descriptor referring to the console" error?

Also read: Error: You need to resolve your current index first: 4 Fixes

Hello There!

If you like what you read, please support our publication by sharing it with your friends, family and colleagues. We're an ad-supported publication. So, if you're running an Adblocker, we humbly request you to whitelist us.







>