Question:
How do i command my linux machine to run or open a file..?
Joubin J
2009-02-06 01:38:21 UTC
so i have a mac and i get around the terminal and i know most of the commands. ie open application.*

however im trying to figur out linux and im stuck
are there diffrent kinds of linux and therefore different commands.
how do i tell my pclinux to open a .torrent file. same as if i web and double clicked on it.
Four answers:
2009-02-09 07:43:15 UTC
you need to run the torrent program you have eg



/usr/bin/rtorrent ~/mytorrent.torrent
DraugTheWhopper
2009-02-07 05:07:16 UTC
First, never use the root user for everyday tasks. That's *asking* for trouble. To read a file in the linux command line, just type "cat filename"(without the quotes). If the file is a long one, it will scroll all the way through the window and you won't be able to read the top part of the file. If that happens, just use "less filename", this will open the file so that you can scroll up or down with the arrow keys or Pgup/Pgdn. just hit "q" to exit the less program and get back to the shell. To edit a file use an editor like vim or emacs. Typing "vim filename" will open the file for editing. Personally, I like nano and its precursor pico, but they may may not be included in your linux distro by default. They do not have as steep a learning curve as vim and emacs, just be informed: preceding a letter with a caret like "^X" means to press the Ctrl key at the same time as the letter. If you want to open a file with another program, try preceding the filename with the program name like"ktorrent filename.torrent". This assumes you have the program on your computer and can run it.
jerry t
2009-02-06 15:13:15 UTC
Nearly all (95%) of the linux distros use the same commands on the command line. They use what is called the bash shell. Below is a short explanation of some ofthe bash commands.

The command open is not the standard command to open a file. Take a look at man open.

There are different commands to open different types of files:

to open/run a program; firefox will run the firefox browser.

to open a text file; less filename.txt will open a file named filename.txt

eog will open an image in an imageviewer.

I believe that "If no application name is specified, the

default application as determined via LaunchServices is used to open the specified files." does not work on the command line. If for example you simply type on the command line mybook.pdf it will say command not found and will not use a default app.

I do not remember what type of file .torrent is but you need to specify what you want to use to open .torrent.
nanaji j
2009-02-06 09:53:04 UTC
to edit



vi "filename"



to view

cat "filename"


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...