LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-30-2024, 08:16 AM   #1
Jason.nix
Member
 
Registered: Feb 2023
Posts: 567

Rep: Reputation: 10
Post See running commands from other sessions


Hello,
I have connected to a server with SSH and executed a command. Now I open another terminal and connect to the same server with the same username with SSH. How can I see in this new session what command is running in the previous session?

Thank you.
 
Old 03-30-2024, 09:25 AM   #2
lvm_
Member
 
Registered: Jul 2020
Posts: 975

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
ps -t tty-of-the-other-session or ps -s its-session-id
 
Old 03-30-2024, 09:40 AM   #3
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,730

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
What do you mean by "see" in this context?
If you mean detect, then the answer already provided should suffice. If you want to view the OUTPUT of the command, that is a different question.
 
Old 03-31-2024, 11:50 PM   #4
friendlysalmon8827
Member
 
Registered: Dec 2023
Distribution: Anfroid,Debian
Posts: 130

Rep: Reputation: 7
I think taht there is a key question that hasn't been asked. Does the OP happen to have an account or an account that has sudo access because if he/sh doesn't have some form of administrative access to the machine in question then this I'm sorry to say is a fishing expedition without an end.
 
Old 04-01-2024, 01:21 AM   #5
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,823

Rep: Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213
ps -e lists all processes.
ps -f is a full listing (including cmd args)
Together
Code:
ps -fe
A full listing of your processes only:
Code:
ps -fu $USER
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iw can see one device but not the other; iwconfig can see the other device but not the first RandomTroll Linux - Wireless Networking 2 02-03-2022 07:22 AM
Running 2 X sessions, 2 WM, WM1 stops running spotify after I switch to WM2. MrUmunhum Linux - Software 0 01-07-2017 02:47 AM
can see other machines, but other machines can't see me with TPC/IP egomez Linux - Networking 8 04-28-2006 01:08 AM
Gwenview can't see certain files (but can see other of same type) mr.flywheel Linux - Software 0 12-18-2004 09:11 AM
can't see other machines but they can see each other Silly22 Linux - Networking 1 11-20-2002 03:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:31 PM.

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