Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

1 votes
2 answers
6871 views
Why is memory (rss) from ps command different than memory seen in top command?
Here on MacOS Catalina, when checking the memory usage of a process I see that the `ps` command shows a RSS value which is different from the memory usage shown in top: ``` $> ps e -o command,vsize,rss,%mem|grep "myapplication"|head -n 1 myapplication 4594896 51364 0.3 ``` **RSS -> 51364** ``` top P...
Here on MacOS Catalina, when checking the memory usage of a process I see that the ps command shows a RSS value which is different from the memory usage shown in top:
$> ps e -o command,vsize,rss,%mem|grep "myapplication"|head -n 1
myapplication  4594896  51364  0.3
**RSS -> 51364**
top
PID    COMMAND       %CPU TIME    #TH             #WQ  #PORT MEM    
48106  myapplication 115.7        09:06.12 69/1   1    101   37M+
**MEM -> 37M** Why this difference? **UPDATE:** Another example with IntelliJ process:
top -pid 357
PID  COMMAND      %CPU TIME     #TH   #WQ  #POR MEM    PURG CMPRS  PGRP PPID STATE    BOOSTS        %CPU_ME %CPU_OTHRS UID       FAULTS    COW   MSGSENT  MSGRECV  SYSBSD
357  idea         2.6  03:16:46 112   1    925  4906M  0B   1583M  357  1    sleeping  0      0.00000 0.00000    281451937 28337096  54627 8404446+ 2733245+ 156093159+
Top shows **4906M**
ps aux
USER               PID  %CPU %MEM        VSZ    RSS   TT  STAT STARTED      TIME COMMAND

xxxxxxx            357   3.6 14.5 180050484 2430728   ??  S     1:44PM 196:48.70 /Applications/IntelliJ IDEA.app/Contents/MacOS/idea -psn_0_73746
ps shows RSS **2430728** (KB)
codependent (123 rep)
Mar 30, 2020, 12:01 PM • Last activity: Jul 26, 2025, 04:06 PM
0 votes
1 answers
2261 views
How can I view threads for a running process that is creating threads?
I made a very small program that creates two threads: #include #include #include void *start() { printf("Am a new thread!\n"); printf("%d\n",pthread_self()); } void main() { pthread_t thread_id1; pthread_t thread_id2; pthread_create(&thread_id1,NULL,start,NULL); pthread_create(&thread_id2,NULL,start...
I made a very small program that creates two threads: #include #include #include void *start() { printf("Am a new thread!\n"); printf("%d\n",pthread_self()); } void main() { pthread_t thread_id1; pthread_t thread_id2; pthread_create(&thread_id1,NULL,start,NULL); pthread_create(&thread_id2,NULL,start,NULL); //pthread_join(thread_id,NULL); sleep(30); } When I compile and run the program with: gcc create.c -lpthread ./a.out And I open a new terminal and try to view the threads, this is what I get: ps -efL | grep a.out root 1943 20158 1943 0 1 15:25 pts/4 00:00:00 ./a.out root 1985 1889 1985 0 1 15:25 pts/5 00:00:00 grep --color=auto a.out So why can't I see two thread ids here?
alkabary (1539 rep)
Apr 4, 2019, 09:27 PM • Last activity: Jul 3, 2025, 02:02 AM
-1 votes
1 answers
72 views
Why a process can own 3 names in Linux?
We migrated an app, changed its name in `Makefile` from `flex_camera` to `flex_camera_lucid`. After deploying it to the target board(the original app is removed), as shown in the following screenshot, we get 3 different names of one process! But why? For the original app `flex_camera`, we can find i...
We migrated an app, changed its name in Makefile from flex_camera to flex_camera_lucid. After deploying it to the target board(the original app is removed), as shown in the following screenshot, we get 3 different names of one process! But why? For the original app flex_camera, we can find it by ps -e or pgrep. But for the migrated app, neither ps -e | grep flex_camera_lucid nor pgrep flex_camera_lucid works. So, why? Finally,what are the determinations of the name of a process in Linux ? --- Makefile:
TARGETS = flex_camera_lucid

#...

.PHONY: default
default: $(TARGETS)

$(TARGETS): $(OBJS)
	$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
Linux console screenshot: enter image description here
Keelung (155 rep)
Jun 20, 2025, 08:06 AM • Last activity: Jun 20, 2025, 12:32 PM
0 votes
2 answers
79 views
how do I prevent script continuation when the process run queue is full?
Environment: shell is BusyBox bash 3.2 running in what started-out as Ubuntu Server many years ago, but has since been tweaked a great deal by the manufacturer of this particular box to become a custom embedded OS. I've encountered a problem that appears to be related to process queuing. I'm hoping...
Environment: shell is BusyBox bash 3.2 running in what started-out as Ubuntu Server many years ago, but has since been tweaked a great deal by the manufacturer of this particular box to become a custom embedded OS. I've encountered a problem that appears to be related to process queuing. I'm hoping someone can advise if there's a better solution that the one described below. I have a bash script that launches several daemons consecutively and in the foreground (no background launches and job control is disabled). After each launch, I grab the returncode $? and check it to ensure there were no issues. Towards the end of this list, (at somewhat random times) launch commands are run, and the following command runs immediately afterward (as if I had just launched the previous one in the background with &). After some investigation, it seems the daemon launching command was received, and is queued. The process state will either be sleeping or runnable (and eventually running). **I need my script to wait for each launch to complete before continuing.** After locating the process ID by grepping ps, I tried wait $pid but this failed to do-so. The usual $! is empty. I've now constructed a loop that watches for the launch process ID directory in /proc to disappear. When it does, it's safe to assume the launch process completed. Is there a way to force my script to wait for each command to finish before proceeding? Has anyone encountered this behaviour before?
OneCheapDrunk (43 rep)
Jun 7, 2025, 08:30 AM • Last activity: Jun 15, 2025, 05:01 AM
7 votes
2 answers
397 views
How can I find location of PRI in /proc
I have `sshd` with `PID` of 1957: mohsen@debian:~$ ps ax -o pid,nice,pri,cmd |grep 1957 1957 -2 21 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups According to above, my `nice` number is -2 and `pri` number is 21. According to `/proc/1957`, I can't find my `nice` number and `pri` number. roo...
I have sshd with PID of 1957: mohsen@debian:~$ ps ax -o pid,nice,pri,cmd |grep 1957 1957 -2 21 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups According to above, my nice number is -2 and pri number is 21.
According to /proc/1957, I can't find my nice number and pri number.
root@debian:~# cd /proc/1957 root@debian:/proc/1957# cat sched sshd (1957, #threads: 1) ------------------------------------------------------------------- se.exec_start : 211942985.934983 se.vruntime : 31.031644 se.sum_exec_runtime : 23.385935 se.nr_migrations : 14 nr_switches : 57 nr_voluntary_switches : 18 nr_involuntary_switches : 39 se.load.weight : 1624064 se.avg.load_sum : 4366 se.avg.runnable_sum : 4470824 se.avg.util_sum : 1557504 se.avg.load_avg : 147 se.avg.runnable_avg : 95 se.avg.util_avg : 33 se.avg.last_update_time : 211909716609024 se.avg.util_est : 38 policy : 0 prio : 118 clock-delta : 89 mm->numa_scan_seq : 0 numa_pages_migrated : 0 numa_preferred_nid : -1 total_numa_faults : 0 current_node=0, numa_group_id=0 numa_faults node=0 task_private=0 task_shared=0 group_private=0 group_shared=0 Where in /proc are the number pri and nice stored?
PersianGulf (11308 rep)
Jun 5, 2025, 05:42 AM • Last activity: Jun 5, 2025, 10:29 PM
47 votes
3 answers
123277 views
How can I make 'ps' command show memory in MB instead of KB?
The Linux [`ps`][1] command shows different memory usages like RSS ([resident set size][2]), size in kB by default. Is there a way to show in MB or GB, like `ls -s --human-readable` does? [1]: https://linux.die.net/man/1/ps [2]: https://en.wikipedia.org/wiki/Resident_set_size
The Linux ps command shows different memory usages like RSS (resident set size ), size in kB by default. Is there a way to show in MB or GB, like ls -s --human-readable does?
balki (4717 rep)
Jun 21, 2017, 02:40 AM • Last activity: Apr 28, 2025, 09:22 AM
0 votes
3 answers
62 views
Rsync does not continue transfer after laptop wakes from sleep
Rsync local source and fuse mounted cloud destination transfer hangs and laptop wifi stops working because closing lid suspends laptop. Wifi restored but rsync does not continue with file transfer. I didn't run rsync with `-P`: ``` rsync -vva --exclude source dest 1>out.log 2>err.log ``` ``` $ ps au...
Rsync local source and fuse mounted cloud destination transfer hangs and laptop wifi stops working because closing lid suspends laptop. Wifi restored but rsync does not continue with file transfer. I didn't run rsync with -P:
rsync -vva --exclude source dest 1>out.log 2>err.log
$ ps aux | grep rsync
user   738104  0.0  0.0 229708  2560 pts/6    S+   00:06   0:27 rsync -vva --exclude cloudDrive/ /home /home/user/cloudDrive/backup/2024-09-27T00:06:05+02:00
user   738105  0.0  0.0 289016  1876 pts/6    S+   00:06   0:00 rsync -vva --exclude cloudDrive/ /home /home/user/cloudDrive/backup/2024-09-27T00:06:05+02:00
user   738119  0.0  0.0 307384  1476 pts/6    D+   00:06   0:32 rsync -vva --exclude cloudDrive/ /home /home/user/cloudDrive/backup/2024-09-27T00:06:05+02:00
user   749293  0.0  0.0 221632  1536 pts/4    S+   00:16   0:00 tail -f /tmp/rsync_backup_out.log
user   983692  0.0  0.0 221632  1408 pts/7    S+   01:00   0:00 tail -f /tmp/rsync_backup_err.log
user  1199890  0.0  0.0 224692  2304 pts/8    S+   10:27   0:00 man rsync
user  1199899  0.0  0.0 224528   888 pts/8    S+   10:27   0:00 man rsync
user  1263878  0.0  0.0 222436  2176 pts/18   S+   16:41   0:00 grep --color=auto rsync
rsync  version 3.3.0  protocol version 31
## Update: I accidentally cancelled the rsync process with Ctrl+C so the question now is, will using --partial on the next run of rsync skip already transferred files and only transfer the remaining in the source directory?
bit (1176 rep)
Sep 27, 2024, 02:53 PM • Last activity: Apr 21, 2025, 04:21 PM
0 votes
2 answers
51 views
procps' watch together with ps command truncates command lines
The setup is I have two folders now under my current directory, `busybox-1.36.1` and `procps-4.0.4`, and I also have a service `languagetool` running with `DynamicUser=yes`. Now observe the different behaviour: Legend: ✅ Doesn't truncate; ❌ truncates. ### busybox watch & busybox ps ✅ ```bash ./busyb...
The setup is I have two folders now under my current directory, busybox-1.36.1 and procps-4.0.4, and I also have a service languagetool running with DynamicUser=yes. Now observe the different behaviour: Legend: ✅ Doesn't truncate; ❌ truncates. ### busybox watch & busybox ps ✅
./busybox-1.36.1/bin/watch './busybox-1.36.1/bin/ps aux | grep languagetool'
Every 2.0s: ./busybox-1.36.1/bin/ps aux | grep languagetool                                                                           2025-03-17 23:20:02

1026972 61534    39:36 java ...languagetool...
4053857 mathiass  0:00 ./busybox-1.36.1/bin/watch ./busybox-1.36.1/bin/ps aux | grep languagetool
4053882 mathiass  0:00 sh -c -- ./busybox-1.36.1/bin/ps aux | grep languagetool
4053884 mathiass  0:00 grep languagetool
### busybox watch & procps ps ✅
./busybox-1.36.1/bin/watch './procps-4.0.4/bin/ps aux | grep languagetool'
Every 2.0s: ./procps-4.0.4/bin/ps aux | grep languagetool

languag+ 1026972  0.1 13.6 14468788 4464816 ?    Ssl  Mar04  39:38 java ...languagetool...
mathias+ 4057218  0.0  0.0   4676  2244 pts/32   S+   23:35   0:00 ./busybox-1.36.1/bin/watch ./procps-4.0.4/bin/ps aux | grep languagetool
mathias+ 4057222  0.0  0.0 231736  3788 pts/32   S+   23:35   0:00 sh -c -- ./procps-4.0.4/bin/ps aux | grep languagetool
mathias+ 4057224  0.0  0.0 230732  2520 pts/32   S+   23:35   0:00 grep languagetool
### procps watch & procps ps ❌
./procps-4.0.4/bin/watch './procps-4.0.4/bin/ps aux | grep languagetool'
Every 2.0s: ./procps-4.0.4/bin/ps aux | grep languagetool

mathias+ 4056463  0.0  0.0 230836  3320 pts/32   S+   23:31   0:00 ./procps-4.0.4/bin/watch ./procps-4.0.4/bin/ps aux | grep languagetool
mathias+ 4056540  0.0  0.0 230836  1532 pts/32   S+   23:32   0:00 ./procps-4.0.4/bin/watch ./procps-4.0.4/bin/ps aux | grep languagetool
mathias+ 4056541  0.0  0.0 231736  3556 pts/32   S+   23:32   0:00 sh -c -- ./procps-4.0.4/bin/ps aux | grep languagetool
mathias+ 4056543  0.0  0.0 230732  2244 pts/32   S+   23:32   0:00 grep languagetool
### procps watch & busybox ps ✅
./procps-4.0.4/bin/watch './busybox-1.36.1/bin/ps aux | grep languagetool'
Every 2.0s: ./busybox-1.36.1/bin/ps aux | grep languagetool                                                                nixos: Mon Mar 17 23:33:31 2025

1026972 61534    39:38 java ...languagetool...
4056826 mathiass  0:00 ./procps-4.0.4/bin/watch ./busybox-1.36.1/bin/ps aux | grep languagetool
4056831 mathiass  0:00 ./procps-4.0.4/bin/watch ./busybox-1.36.1/bin/ps aux | grep languagetool
4056832 mathiass  0:00 sh -c -- ./busybox-1.36.1/bin/ps aux | grep languagetool
4056834 mathiass  0:00 grep languagetool
## Question It seems odd that in every other case the commands behave as I expect them to, except when trying to use both ps and watch from procps. Does anybody know what is going on here?
Mathias Sven (273 rep)
Mar 17, 2025, 11:41 PM • Last activity: Mar 18, 2025, 01:56 PM
0 votes
0 answers
30 views
How does printf() actually work?
When I execute the c file ``` #include #include int main(){ printf("before the system call. I am too excited!\n"); system("ps"); printf("after the system call. Look what you have done!\n"); } ``` I get the output ``` before the system call. I am too excited! PID TTY TIME CMD 140 pts/0 00:00:03 zsh 1...
When I execute the c file
#include 
#include 

int main(){
        printf("before the system call. I am too excited!\n");
        system("ps");
        printf("after the system call. Look what you have done!\n");
}
I get the output
before the system call. I am too excited!
    PID TTY          TIME CMD
    140 pts/0    00:00:03 zsh
   1613 pts/0    00:00:00 system
   1614 pts/0    00:00:00 sh
   1615 pts/0    00:00:00 ps
after the system call. Look what you have done!
but when I remove the '\n' from the first printf(), I get
PID TTY          TIME CMD
    140 pts/0    00:00:03 zsh
   1590 pts/0    00:00:00 system
   1591 pts/0    00:00:00 sh
   1592 pts/0    00:00:00 ps
before the system call. I am too excited!after the system call. Look what you have done!
So what I am asking is, how the '\n' character changes the printf() output, and it led me to thinking, does the program stores the text in some buffer before printing, or just prints with the go? I am getting the expected output for the second if I add fflush(stdout) for before the system("ps"), but I want to understand the exact mechanism. When I add fflush(stdout), it cleared the buffer of the first printf() and the output of system("ps") was appended with it, but without it, what is exactly happening?
KeShAw (13 rep)
Mar 6, 2025, 08:48 AM • Last activity: Mar 6, 2025, 09:07 AM
0 votes
1 answers
51 views
How long has a process been idle since it last ran?
I am interested in finding out the last time a process was scheduled to run. That is, how long it has been sleeping, since it last ran. When was it last active? Basically, a generalization of what the `w` command prints, but for all processes, and not just the login shells. To make this concrete: th...
I am interested in finding out the last time a process was scheduled to run. That is, how long it has been sleeping, since it last ran. When was it last active? Basically, a generalization of what the w command prints, but for all processes, and not just the login shells. To make this concrete: the w command prints a list of user sessions, when they logged in, and how long they've been idle. For example:
$ w
 17:17:04 up 10 days, 17:35,  2 users,  load average: 0.28, 0.26, 0.30
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
linas    tty7     :0               31Jan25 10days 13:27m  2.09s mate-session
linas    pts/7    10.70.70.2       16:54    7:08  0.07s  0.07s -bash
This says that linas logged in on pts/7 twenty-three minutes ago (17:17 minus 16:54) and did some typing at the keyboard, burning a trivial amount of CPU time, and then did nothing at all for seven minutes and eight seconds. In the kernel, the process bash is in interruptible sleep, waiting for keyboard input, and has been like that for 7:08 mm:ss. How can I get this info for *all* processes? Or, if that's not available, then all ptys? So, pts/1 though /6 also have bash attached to them, but they're ... idle. No one is typing into them, right now. It seems like the ps command should be able to show this, but I can't figure it out. Perhaps this info is in /proc/ but if so, not clear where. The GPT/LLM chatbots all cluelessly provide nothing but wrong answers (insisting on ps -o etime which is something else entirely.)
Linas (205 rep)
Feb 11, 2025, 11:41 PM • Last activity: Feb 12, 2025, 12:10 AM
2 votes
2 answers
158 views
Get full command name of high memory usage process in UNIX
I am trying to capture process name which are using high memory on my box. I ran below command to get that while [ 1 ] do ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head sleep 5 done But the issue it is not giving me the full cmd details which is running against the PID. Output I am getting is lik...
I am trying to capture process name which are using high memory on my box. I ran below command to get that while [ 1 ] do ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head sleep 5 done But the issue it is not giving me the full cmd details which is running against the PID. Output I am getting is like this : PID PPID CMD %MEM %CPU 916 915 /usr/bin/perl /release/data/ 11.9 0.2 831 830 /usr/bin/perl -w /release/da 6.5 0.0 608 607 /etc/alternatives/java_sdk_ 2.4 1.2 135 134 /etc/alternatives/java_sdk_ 1.4 1.6 I want to capture the full cmd of the PID.
Developer (249 rep)
May 27, 2021, 07:51 PM • Last activity: Jan 28, 2025, 02:42 PM
1 votes
1 answers
47 views
Why read process doesn't show up in ps -ef
I open two terminal windows. In one, I run: ```none $ read foo ``` I don't press RETURN , so `read` is blocking. In the other terminal window, I search for the process: ```none $ ps -ef | grep foo user 95292 94814 0 08:04 pts/11 00:00:00 grep foo ``` However, the running `read` process is not showin...
I open two terminal windows. In one, I run:
$ read foo
I don't press RETURN, so read is blocking. In the other terminal window, I search for the process:
$ ps -ef | grep foo
user        95292   94814  0 08:04 pts/11   00:00:00 grep foo
However, the running read process is not showing up? What am I doing wrong?
Ruben P. Grady (31 rep)
Jan 21, 2025, 12:07 AM • Last activity: Jan 21, 2025, 12:24 AM
7 votes
3 answers
7553 views
How do I filter by STAT with ps?
I am trying to get all the processes for which the value corresponding to the STAT column is X. I have done this using awk ``` ps -aux | awk {'if ($8 == "S") print $8" "$11'} ``` However, I would like to do it without using a program other than ps. Is there a way?
I am trying to get all the processes for which the value corresponding to the STAT column is X. I have done this using awk
ps -aux | awk {'if ($8 ==  "S") print $8" "$11'}
However, I would like to do it without using a program other than ps. Is there a way?
edoreld (173 rep)
Mar 10, 2017, 03:56 PM • Last activity: Dec 19, 2024, 02:33 PM
12 votes
1 answers
10189 views
Get PID from TID
I run [`iotop`](http://guichaz.free.fr/iotop/) to check on programs that are heavy disk users, in case I need to decrease their priority. Usually this is good enough, but `iotop` only shows thread ID (TID), and sometimes I want to know process ID (PID) so I can find out more about which process is r...
I run [iotop](http://guichaz.free.fr/iotop/) to check on programs that are heavy disk users, in case I need to decrease their priority. Usually this is good enough, but iotop only shows thread ID (TID), and sometimes I want to know process ID (PID) so I can find out more about which process is responsible. Unfortunately, while ps can display TID (a.k.a SPID, LWP), it doesn't have a flag to take a list of TIDs the way it does for a list of PIDs with --pid. The best I can do is list TIDs and then grep the output. For example, if the thread id is 792, I can do $ ps -eLf | grep ' 792 ' which works reasonably well, but is a little inelegant. Is there a better way?
Nathaniel M. Beaver (1398 rep)
Mar 15, 2018, 04:35 PM • Last activity: Dec 18, 2024, 06:00 AM
30 votes
3 answers
43284 views
ps: full command is too long
I use 'ps' to see command that starts process. The issue is that command is too long and 'ps' does not show it entirely. Example: I use command 'ps -p 2755 | less' and have following output PID TTY STAT TIME COMMAND 2755 ? Sl 305:05 /usr/java/jdk1.6.0_37/bin/java -Xms64m -Xmx512m -Dflume.monitoring....
I use 'ps' to see command that starts process. The issue is that command is too long and 'ps' does not show it entirely. Example: I use command 'ps -p 2755 | less' and have following output PID TTY STAT TIME COMMAND 2755 ? Sl 305:05 /usr/java/jdk1.6.0_37/bin/java -Xms64m -Xmx512m -Dflume.monitoring.type=GANGLIA -Dflume.monitoring.hosts=prod.hostname.ru:8649 -cp /etc/flume-ng/conf/acrs-event:/usr/lib/flume-ng/lib/*:/etc/hadoop/conf:/usr/lib/hadoop/lib/activation-1.1.jar:/usr/lib/hadoop/lib/asm-3.2.jar:/usr/lib/hadoop/lib/avro-1.7.4.jar:/usr/lib/hadoop/lib/commons-beanutils-1.7.0.jar:/usr/lib/hadoop/lib/commons-beanutils-core-1.8.0.jar:/usr/lib/hadoop/lib/commons-cli-1.2.jar:/usr/lib/hadoop/lib/commons-codec-1.4.jar:/usr/lib/hadoop/lib/commons-collections-3.2.1.jar:/usr/lib/hadoop/lib/commons-compress-1.4.1.jar:/usr/lib/hadoop/lib/commons-configuration-1.6.jar:/usr/lib/hadoop/lib/commons-digester-1.8.jar:/usr/lib/hadoop/lib/commons-el-1.0.jar:/usr/lib/hadoop/lib/commons-httpclient-3.1.jar:/usr/lib/hadoop/lib/commons-io-2.1.jar:/usr/lib/hadoop/lib/commons-lang-2.5.jar:/usr/lib/hadoop/lib/commons-logging-1.1.1.jar:/usr/lib/hadoop/lib/commons-math-2.1.jar:/usr/lib/hadoop/lib/commons-net-3.1.jar:/usr/lib/hadoop/lib/guava-11.0.2.jar:/usr/lib/hadoop/lib/jackson-core-asl-1.8.8.jar:/usr/lib/hadoop/lib/jackson-jaxrs-1.8.8.jar:/usr/lib/hadoop/lib/jackson-mapper-asl-1.8.8.jar:/usr/lib/hadoop/lib/jackson-xc-1.8.8.jar:/usr/lib/hadoop/lib/jasper-compiler-5.5.23.jar:/usr/lib/hadoop/lib/jasper-runtime-5.5.23.jar:/usr/lib/hadoop/lib/jaxb-api-2.2.2.jar:/usr/lib/hadoop/lib/jaxb-impl-2.2.3-1.jar:/usr/lib/hadoop/lib/jersey-core-1.8.jar:/usr/lib/hadoop/lib/jersey-json-1.8.jar:/usr/lib/hadoop/lib/jersey-server-1.8.jar:/usr/lib/hadoop/lib/jets3t-0.6.1.jar:/usr/lib/hadoop/lib/jettison-1.1.jar:/usr/lib/hadoop/lib/jetty-6.1.26.cloudera.2.jar:/usr/lib/hadoop/lib/jetty-util-6.1.26.cloudera.2.jar:/usr/lib/hadoop/lib/jline-0.9.94.jar:/usr/lib/hadoop/lib/jsch-0.1.42.jar:/usr/lib/hadoop/lib/jsp-api-2.1.jar:/usr/lib/hadoop/lib/jsr305-1.3.9.jar:/usr/lib/hadoop/lib/junit-4.8.2.jar:/usr/lib/hadoop/lib/kfs-0.3.jar:/usr/lib/hadoop/lib/log4j-1.2.17.jar:/usr/lib/hadoop/lib/mockito-all-1.8.5.jar:/usr/lib/hadoop/lib/native:/usr/lib/hadoop/lib/paranamer-2.3.jar:/usr/lib/hadoop/lib/protobuf-java-2.4.0a.jar:/usr/lib/hadoop/lib/servlet-api-2.5.jar:/usr/lib/hadoop/lib/snappy-java-1.0.4.1.jar:/usr/lib/hadoop/lib/stax-api-1.0.1.jar:/usr/lib/hadoop/lib/xmlenc-0.52.jar:/usr/lib/hadoop/lib/xz-1.0.jar:/usr/lib/hadoop/lib/zookeeper-3.4.5-cdh4.3.0.jar:/usr/lib/hadoop/.//bin:/usr/lib/hadoop/.//cloudera:/usr/lib/hadoop/.//etc:/usr/lib/hadoop/.//hadoop-annotations-2.0.0-cdh4.3.0.jar:/usr/lib/hadoop/.//hadoop-annotations.jar:/usr/lib/hadoop/.//hadoop-auth-2.0.0-cdh4.3.0.jar:/usr/lib/hadoop/.//hadoop-auth.jar:/usr/lib/hadoop/.//hadoop-common-2.0.0-cdh4.3.0.jar:/usr/lib/hadoop/.//hadoop-common-2.0.0-cdh4.3.0-tests.jar:/usr/lib/hadoop/.//hadoop-common.jar:/usr/lib/hadoop/.//lib:/usr/lib/hadoop/.//libexec:/usr/lib/hadoop/.//sbin:/usr/lib/hadoop-hdfs/./:/usr/lib/hadoop-hdfs/lib/asm-3.2.jar:/usr/lib/hadoop-hdfs/lib/commons-cli-1.2.jar:/usr/lib/hadoop-hdfs/lib/commons-codec-1.4.jar:/usr/lib/hadoop-hdfs/lib/commons-daemon-1.0.3.jar:/usr/lib/hadoop-hdfs/lib/commons-el-1.0.jar:/usr/lib/hadoop-hdfs/lib/commons-io-2.1.jar:/usr/lib/hadoop-hdfs/lib/commons-lang-2.5.jar:/usr/lib/hadoop-hdfs/lib/commons-logging-1.1.1.jar:/usr/lib/hadoop-hdfs/lib/guava-11.0.2.jar:/usr/lib/hadoop-hdfs/lib/jackson-core-asl-1.8.8.jar:/usr/lib/hadoop-hdfs/lib/jackson-mapper-asl-1.8.8.jar:/usr/lib/hadoop-hdfs/lib/jasper-runtime-5.5.23.jar:/usr/lib/hadoop-hdfs/lib/jersey-core-1.8.jar:/usr/lib/hadoop-hdfs/lib/jersey-server-1.8.jar:/usr/lib/hadoop-hdfs/lib/jetty-6.1.26.cloudera.2.jar:/usr/lib/hadoop-hdfs/lib/jetty-util-6.1.26.cloudera.2.jar:/usr/lib/hadoop-hdfs/lib/jline-0.9.94.jar:/usr/lib/hadoop-hdfs/lib/jsp-api-2.1.jar:/usr/lib/hadoop-hdfs/lib/jsr305-1.3.9.jar:/usr/lib/hadoop-hdfs/lib/log4j-1.2.17.jar:/usr/lib/hadoop-hdfs/lib/protobuf-java-2.4.0a.jar:/usr/lib/hadoop-hdfs/lib/servlet-api-2.5.jar:/usr/lib/hadoop-hdfs/lib/xmlenc-0.52.jar:/usr/lib/hadoop-hdfs/lib/zookeeper-3.4.5-cdh4.3.0.jar:/usr/lib/hadoop-hdfs/.//bin:/usr/lib/hadoop-hdfs/.//cloudera:/usr/lib/hadoop-hdfs/.//hadoop-hdfs-2.0.0-cdh4.3.0.jar:/usr/lib/hadoop-hdfs/.//hadoop-hdfs-2.0. So, the command line is too long and the command stops mid-phrase. How can I see it whole?
V. Artyukhov (447 rep)
Sep 20, 2013, 08:59 AM • Last activity: Dec 7, 2024, 12:30 PM
0 votes
1 answers
33 views
How to sort correctly the processes hungry of ram?
With this cmd line I see processes and use of ram in mb ps aux | awk '{print $6/1024 " MB\t\t" $11}' | sort -rn|less The problem is the sort 9.95703 MB /usr/lib/systemd/systemd-journald 9.89062 MB /usr/sbin/winbindd 9.76953 MB /usr/sbin/winbindd 9.69922 MB php-fpm: 9.69922 MB php-fpm: 9.69531 MB php...
With this cmd line I see processes and use of ram in mb ps aux | awk '{print $6/1024 " MB\t\t" $11}' | sort -rn|less The problem is the sort 9.95703 MB /usr/lib/systemd/systemd-journald 9.89062 MB /usr/sbin/winbindd 9.76953 MB /usr/sbin/winbindd 9.69922 MB php-fpm: 9.69922 MB php-fpm: 9.69531 MB php-fpm: 9.69531 MB php-fpm: 9.69531 MB php-fpm: 93.4297 MB db_arc1_FREE 9.31641 MB winbindd: 9.31641 MB /usr/sbin/snmpd How to sort correctly so the output became like this? 93.4297 MB db_arc1_FREE 9.95703 MB /usr/lib/systemd/systemd-journald 9.89062 MB /usr/sbin/winbindd 9.76953 MB /usr/sbin/winbindd 9.69922 MB php-fpm: 9.69922 MB php-fpm: 9.69531 MB php-fpm: 9.69531 MB php-fpm: 9.69531 MB php-fpm: 9.31641 MB winbindd: 9.31641 MB /usr/sbin/snmpd
elbarna (13690 rep)
Nov 29, 2024, 08:18 PM • Last activity: Nov 30, 2024, 09:39 AM
2 votes
2 answers
1031 views
What are these processes and why can't I kill them?
(On OS X 10.11.3) I'm having a problem starting a java process that needs to listen on port 8040. Getting a BindException. So seems like somebody else is already listening on it. A quick check confirms that: lsof -i TCP| fgrep LISTEN | grep 8040 jspawnhel 13566 alon 255u IPv6 0x2a5edc8fe0a093d7 0t0...
(On OS X 10.11.3) I'm having a problem starting a java process that needs to listen on port 8040. Getting a BindException. So seems like somebody else is already listening on it. A quick check confirms that: lsof -i TCP| fgrep LISTEN | grep 8040 jspawnhel 13566 alon 255u IPv6 0x2a5edc8fe0a093d7 0t0 TCP *:8040 (LISTEN) jspawnhel 14482 alon 255u IPv6 0x2a5edc8fe0a093d7 0t0 TCP *:8040 (LISTEN) jspawnhel 81770 alon 255u IPv6 0x2a5edc8fe0a093d7 0t0 TCP *:8040 (LISTEN) So, I'm trying to figure out what these processes are, but I don't understand what ps is showing me: ps ax | grep "13566\|14482\|81770" 13566 ?? U 0:00.00 313:316 14482 ?? U 0:00.00 324:327 81770 ?? U 0:00.00 301:304 what does the "??" mean? what is 313:316 in this context? I can't kill it either, even with -9: kill -9 13566 ps ax | grep 13566 13566 ?? U 0:00.00 313:316 Tried many times... Any help is appreciated.
Legato (123 rep)
Apr 4, 2016, 02:19 PM • Last activity: Nov 22, 2024, 12:08 AM
0 votes
1 answers
52 views
Why is pid changed in different terminal session?
I use WSL2 and was trying to use gdb to debug a c code following this gdb [cheatsheet.][1] In summary it shows a way to call a python code solve.py that calls a c code, and displays the pid of itself. And in another terminal session, I run gdb to communicate with the solve.py process by specifying t...
I use WSL2 and was trying to use gdb to debug a c code following this gdb cheatsheet. In summary it shows a way to call a python code solve.py that calls a c code, and displays the pid of itself. And in another terminal session, I run gdb to communicate with the solve.py process by specifying the pid of solve.py. However I realized I was failing to communicate with solve.py because the process pid was wrong. I ran ps and found out the solve.py was slightly different with what I saw in the first terminal. Can anyone explain why? Below is a demonstration. (env) junha@DESKTOP-3B9ANKQ:~/cs2107$ python3 solve.py [+] Starting local process './test': pid 627 [*] Paused (press any to continue) then I am supposed to run gdb -p 627 as given in the cheatsheet. But it doesn't work, and when I use ps a, I see that the actually pid is 624 not 627. junha@DESKTOP-3B9ANKQ:~$ ps a PID TTY STAT TIME COMMAND 226 hvc0 Ss+ 0:00 /sbin/agetty -o -p -- \u --noclear --keep-baud - 115200,38400,9600 vt220 231 tty1 Ss+ 0:00 /sbin/agetty -o -p -- \u --noclear - linux 388 pts/0 Ss 0:00 -bash 389 pts/1 Ss 0:00 /bin/login -f 508 pts/1 S+ 0:00 -bash 573 pts/2 Ss 0:00 -bash 624 pts/0 S+ 0:00 python3 solve.py 627 pts/3 Ss+ 0:00 ./test 629 pts/2 R+ 0:00 ps a and below works: gdb -p 624
B1LLP4RK (29 rep)
Nov 16, 2024, 10:35 AM • Last activity: Nov 16, 2024, 03:45 PM
421 votes
19 answers
247206 views
How can I prevent 'grep' from showing up in ps results?
When I search for some process that doesn't exist, e.g. $ ps aux | grep fnord wayne 15745 0.0 0.0 13580 928 pts/6 S+ 03:58 0:00 grep fnord Obviously I don't care about grep - that makes as much sense as searching for the `ps` process! How can I prevent grep from showing up in the results?
When I search for some process that doesn't exist, e.g. $ ps aux | grep fnord wayne 15745 0.0 0.0 13580 928 pts/6 S+ 03:58 0:00 grep fnord Obviously I don't care about grep - that makes as much sense as searching for the ps process! How can I prevent grep from showing up in the results?
Wayne Werner (12123 rep)
Apr 30, 2013, 01:44 PM • Last activity: Nov 2, 2024, 06:46 PM
2 votes
2 answers
1275 views
ps -aux -U "user" not filtering on user as expected
I have a quick question. I would regularly like to list all the processes running under my account on Linux. After reading the manpage, I thought I'd have to write: ps -aux -U "joshua" to get all processes running under user account ```joshua```. However, this command also lists processes running as...
I have a quick question. I would regularly like to list all the processes running under my account on Linux. After reading the manpage, I thought I'd have to write: ps -aux -U "joshua" to get all processes running under user account
. However, this command also lists processes running as root and other accounts. Am I missing something? Why does this happen? Thank you in advance, Joshua
Joshua Schroijen (123 rep)
Apr 6, 2023, 07:54 AM • Last activity: Oct 1, 2024, 01:59 PM
Showing page 1 of 20 total questions