Htop - How to detect exact command running at background


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Htop - How to detect exact command running at background
# 1  
Old 09-30-2017
Htop - How to detect exact command running at background

Hello,
I am running a python file from terminal and I wish to see which code is running at background. When I use htop, I see just a few commands, unable to see entire command.


Code:
htop > report
nano report

Output:
Code:
^[[?1049h^[[1;34r^[(B^[[m^[[4l^[[?7h^[[?1h^[=^[[?25l^[[39;49m^[[?1000h^[[39;49m^[(B^[[m^[[H^[[2J^[[2d  ^[[36m1  ^[[39m^[(B^[[0;1m[^[$
^[[10d^[(B^[[0m^[[30m^[[42m  PID USER      PRI  NI  VIRT   RES   SHR S ^[[30m^[[46mCPU% ^[[30m^[[42mMEM%   TIME+  Command^[[K
^[[11d^[[30m^[[46m10735 root       20   0 1746M  358M  8044 S 633.  1.1  0:38.28 ffmpeg -y -v error -i /var/www/gr/ru$
^[[34dF1^[[30m^[[46mHelp  ^[[39;49m^[(B^[[mF2^[[30m^[[46mSetup ^[[39;49m^[(B^[[mF3^[[30m^[[46mSearch^[[39;49m^[(B^[[mF4^[[30m^[[46mFi$
^[[?1l^[>

Following parts of ffmpeg line is not shown by htop. Just showing "ffmpeg -y -v error -i /var/www/gr/ru"
Could you please let me know is there a way to see entire command?


Thanks
Boris
# 2  
Old 09-30-2017
Code:
htop

is interactive, so it creates characters to format output. Try the
Code:
ps

command. There is also the
Code:
pstree

command which may be what you want.

You should also be aware that when you issue any command it creates another process owned by the user issuing the command.
# 3  
Old 09-30-2017
Hello Jim,
Thanks for the answer but ps and pstree are also not giving expected result.

Thanks
Boris
# 4  
Old 09-30-2017
check out top command with -b
# 5  
Old 09-30-2017
Did you try ps -ef? This shows full details for all processes.
# 6  
Old 10-02-2017
If your version of ps supports it, consider the -C cmdlist option. cmdlist is a comma-separated list of commands you wish to list with ps.

Andrew
# 7  
Old 10-02-2017
You can customize your ps output with the -o option, for example
Code:
ps -e -o user,pid,vsz,rss,time,args

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Command to get exact tomcat process I am running ignoring other java process

Team, I have multiple batchjobs running in VM, if I do ps -ef |grep java or tomcat I am getting multiple process list. How do I get my exact tomcat process running and that is unique? via shell script? (4 Replies)
Discussion started by: Ghanshyam Ratho
4 Replies

2. UNIX for Dummies Questions & Answers

Sudo ssh with command running in background

I am trying to run a command. This is one of my attempts: for i in fileservera; do ssh -t $i 'sudo ls /';doneThis works, and I see the directories. However, what I want to do now is start a process on the remote server such as /usr/bin/connectproc -standalonesudo /usr/bin/connectproc... (1 Reply)
Discussion started by: newbie2010
1 Replies

3. Solaris

running command in background

hi all i am running following command ufsdump 0ubf 512 /dev/rmt/0cbn /database/backup2/rman_backup/level1 >> /database/backup2/backup_tape/level1_rman_03aug12 2>&1; i want to run it in background how can i do it in this i am generating logs for backup. the problem occurs when i am... (3 Replies)
Discussion started by: nikhil kasar
3 Replies

4. Shell Programming and Scripting

How to know the exact running time of script!

Hi All, newbie here, I'm just wondering how can i know the exact running time of my script? Please advise, THanks, (1 Reply)
Discussion started by: nikki1200
1 Replies

5. Shell Programming and Scripting

command to see process running at background

Hi , I want to see all the background process that are running in unix box machine...please guide me is there any specific command for that..since I am executing some scripts at background..!!:confused: (1 Reply)
Discussion started by: nks342
1 Replies

6. Shell Programming and Scripting

Running in background

Hello, I was trying to make some processes to run at background and went to a problem. First I tried just to loop in one line something like this: for i in {1..10}; do echo 'hello world' &; done; but it pops a syntax error, so I tried several ways to fix it but wasn't able to understand... (2 Replies)
Discussion started by: Rash
2 Replies

7. UNIX for Dummies Questions & Answers

kill a command I am running / then put it to background

I have a command running in the foreground (and so my term window is locked up) and I want to kill it, then resume it in the background and go home. It is creating a zip file, and the file will be written to the current directory - no std in / std out issues. How do I do this? Kill it with a... (3 Replies)
Discussion started by: hindesite
3 Replies

8. UNIX for Dummies Questions & Answers

Running the Script in Background.

Gurus, Pls. help on this to run the script in background. I have a script to run the informatica workflows using PMCMD in script. Say the script name is test.sh & Parameters to the script is Y Y Y Y The no of parameters to the bove script is 4. all are going to be a flags. Each flag will... (2 Replies)
Discussion started by: prabhutkl
2 Replies

9. UNIX for Dummies Questions & Answers

how to detect my script is already running

I have a script which must not be run more than once at any given time. THis script will be scheduled to run every 20 mins as a cron job. In my script can i have logic to say if this script is already running from the previous cron, then exit. How do i go about doing that. If you describe the... (11 Replies)
Discussion started by: rmulchandani
11 Replies

10. Shell Programming and Scripting

running in background

i have a script called server.sh. how to run this script in backgroung using nohup command (5 Replies)
Discussion started by: ali560045
5 Replies
Login or Register to Ask a Question