Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 06-02-2006, 12:48 PM   #1
Registered: Nov 2005
Location: New Jersey, USA
Distribution: SuSE
Posts: 492

Rep: Reputation: 31
Run command on a different terminal

I consider myself a fairly advanced Linux user but have never come by this before. I want to run a command not only as a different user, but redirected to their terminal/session.


Targer computer has a console X Windows session open running KDE. I have KTorrent installed on the computer, which is a KDE-based BitTorrent GUI. It will (obviously) only run in an X-Windows session.

I login as the same user (or su to root) from a remote terminal (SSH2 session).

Now, I want to run ktorrent in the console session, so that it will be there when I get home.

Is there any way to do this? I understand about running commands as different users using su -c but I have no experience with running commands as a different session, or redirecting to a different terminal.

Old 06-02-2006, 01:34 PM   #2
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
You need X to be running if you want to use ktorrent. What I tend to do if I need to run a gui app from a remote machine using ssh is: CTRL-ALT-F1, login into the command line, do "xinit -- :1" to start a new x session, login to the remote machine (ssh -X -Y machine) and run something like startkde to start my DE or WM of choice.
Old 06-02-2006, 01:51 PM   #3
LQ Newbie
Registered: Dec 2004
Posts: 21

Rep: Reputation: 15
This is simple to do.

If you have a target X session up, you can start application from another terminal that show up in your X session by simply setting the DISPLAY variable.

For example, if your X session is DISPLAY=:0

Then, in your ssh text-only window type the following:

export DISPLAY=:0

The KTorrent window should be waiting for you when you get to your X session.

Note that you must already be logged in and have an active X session.


Last edited by LinuxDave; 06-02-2006 at 01:58 PM.
Old 06-07-2006, 01:32 PM   #4
Registered: Nov 2005
Location: New Jersey, USA
Distribution: SuSE
Posts: 492

Original Poster
Rep: Reputation: 31
Thanks, Dave. I'll try it later. That's exactly what I was looking for.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
run command in new gnome-terminal checkchan Linux - General 10 08-29-2012 03:55 AM
Is there a terminal command that I can run that will........... ludwig W Linux - Networking 20 11-28-2005 03:59 PM
How to run MP3 file thru Terminal in K.D.E or Terminal itz2000 Linux - Newbie 5 08-04-2005 09:49 PM
Run user command on Terminal startup coolfrog Linux - General 4 09-26-2004 09:08 AM
start terminal & run command automatically peeples Linux - General 2 09-08-2003 02:57 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:25 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration