Questions tagged [top-command]

Unix/Linux utility providing a "dynamic, real-time view of a running system".

84 questions
1
vote
1 answer

Bash: How do I show the name of a specific java -jar in Top command?

Note: this is not a java question. I'm asking about the Top Command in bash. Often I am running several programs written in java at the same time. For example; `java -jar [program] [options]` I want to check that they are running using top,…
1
vote
1 answer

Top command Android 8

I am trying to read (and understand) the CPU usage provided by the top command in my Samsung Galaxy S7. From another post here I can see the explanation of the top command with the output that this person is getting. However, when I go inside my…
codeKiller
  • 5,493
  • 17
  • 60
  • 115
1
vote
1 answer

Using Top to show output of your Script

In my previous company, there was an engineer who showed me a demo of using top and it was displaying the output of her script. Unfortunately, I do not have any contacts with her anymore. But I find it really amazing that top can display the output.…
Carmen
  • 2,833
  • 4
  • 23
  • 23
1
vote
1 answer

Linux `top` command: how much process memory is physically stored in swap space?

Let's say I run my program on a 64-bit Linux machine with 64 Gb of RAM. In my very small C program immediately after the start I do void *p = sbrk(1024ull * 1024 * 1024 * 120); this moving my data segment break forward by 120 Gb. After the above…
1
vote
0 answers

Output from executing 'busybox top' in Android app run-time differs from shell output

I am trying to create a system application for Android to display the top entries when running busybox top -n 1 command. I implemented this by defining a process in my application: Process p = Runtime.getRuntime().exec(new String[]{"/system/bin/sh",…
Andrew L
  • 21
  • 4
1
vote
0 answers

Unidentified command in linux top command result

We have developed an app and hosted on linux (aws) with 50 gb hard disk and 16 gb of ram (t2.xlarge). We found even in the moderate traffic cpu usage goes up to around 80% When we tried to check the memory usage through terminal we found around…
Chirag Purohit
  • 731
  • 11
  • 20
1
vote
1 answer

Shell script: top command and date command at once

I would like to print in a file the % of cpu usage of a process (top command) + the date when this top command gets the information, for each 0.5 seconds (each line with the date + this cpu information) If I write in a shell script, I would do…
aherrero
  • 313
  • 1
  • 6
1
vote
1 answer

Top Command shows empty percent in cpu usage

I set up a virtual machine with freebsd 9.3 (I also run relayd), and when I execute command top, I get the following results which is kind of wierd: last pid: 22963; load averages: 0.56, 0.20, 0.12 up 1+02:30:06 11:39:54 139 processes: 1…
A. Mashreghi
  • 1,729
  • 2
  • 20
  • 33
1
vote
2 answers

process id ist different between getpid und Top command linux

programm write current process id in file with function getpid() exemple 1100, but wenn command top run, i becomme process id 1101!!!!! why
farka
  • 189
  • 2
  • 5
  • 12
1
vote
1 answer

Find the total time spent by CPU in user mode, sys mode, and real mode

I am wondering if its possible to find out the total time spent by CPU in real mode, sys mode and user mode after the server came up. Top command show the real time % usage, but I am trying to find out the total time spent by CPU since it came…
user2809888
1
vote
3 answers

How to implement the Linux top command UI using JAVA?

How to implement the Linux 'top command' style UI using JAVA? And How to run jar in server side itself, and i can see the state of the program after i log in SSH.
Bruce Dou
  • 4,673
  • 10
  • 37
  • 56
1
vote
1 answer

How do I get an output from Linux Top in Batch Mode on every iteration?

I'm trying to log CPU and Memory stats into a file by using top on an Arch Linux. I'm just interested in one specific process and get the wanted parameters as shown below: top -b -n1 -p 310 | tail -fn 1 | awk '{printf…
Fidel90
  • 1,828
  • 6
  • 27
  • 63
1
vote
0 answers

What does the SWAP column in top command stand for?

Possible Duplicate: how to find out which processes are swapping in linux? I gave the top command and sorted the output using the sort below field. P: SWAP = Swapped size (kb) I was looking for the process id which was consuming the…
Sanjay
  • 103
  • 1
  • 2
  • 5
0
votes
3 answers

Top command special characters in shell script

In the following command i get special characters in alert.txt for the top output.How can i prevent it.... #!/bin/sh topsnapshot=`top -n 5` echo -e "\n\n===========================TOP COMMAND…
Rajeev
  • 44,985
  • 76
  • 186
  • 285
0
votes
2 answers

"Top" output is truncated when redirect to file ?

My project requires "Top" out to be redirect in a file. I am running couple of application. When I tun top on telnet I am getting full path of one of my application. It looks like as follows 2079 1952 root R 12296 2% 0% -s=1…
er.bhargav.vyas
  • 301
  • 2
  • 6