w command : meaning of ":0" and ":0:0" in FROM field [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
What do ":0" and ":0:0" mean in the FROM field ? I'm curious.
USER TTY FROM LOGIN# IDLE JCPU PCPU WHAT
oddjob tty7 :0 18:18 10:03m 3:36 0.07s gdm-session-worker [pam/gdm3]
oddjob tty1 21:45 18:17 47.25s 0.00s xinit /etc/X11/xinit/xinitrc -- /etc/X11/xinit/xserverrc :1 -auth /tmp/serverauth.g2M3EzPqao
oddjob pts/0 :0 20:00 1.00s 0.45s 0.00s script
oddjob pts/1 :0.0 21:05 58:46 0.04s 0.04s /bin/bash

:0 is the first X connection, and :0.0 is the first screen of the first X connection.

Related

why use "use -elf" the result return username with "systemd+"? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 months ago.
Improve this question
when I use docker run -itd mysql,then to use ps -elf check the process infomation with "4 S systemd+ 257584 257561 1 80 0 - 712611 poll_s Jul17 ? 00:40:16 mysqld".
root#xx:/proc/257584/ns# ps -elf | grep mysqld
4 S systemd+ 257584 257561 1 80 0 - 712611 poll_s Jul17 ? 00:40:20 mysqld
root#xx:/proc/257584/ns# ps -el | grep mysqld
4 S 999 257584 257561 1 80 0 - 712611 poll_s ? 00:40:21 mysqld
But I use "cat /cat/passwd" can't find username equal to "systemd+".
docker Version: 20.10.12
os ubuntu20.04
ps (sadly) trims the username to 8 (if i'm counting right) characters and adds a + after the user name initial part. The username could be systemd-mysql or systemd-something that you can find in passwd.
From manual:
If the length of the username is greater than the length of the display column, the username will be truncated. See the -o and -O formatting options to customize length

How to get the PID, process name, command line of the current terminal window session? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I was trying to find out, how do i get the pid, process name, command line of the current terminal(what is running in the background and got started with that terminal)?
By running:
echo $$
15925
You will get the process ID of your current session. Using this process ID, you can then run:
ps -ef | grep 15925
foo 14870 15925 0 10:32 pts/6 00:00:00 sleep 120
foo 14871 15925 0 10:32 pts/6 00:00:00 ps -ef
foo 14872 15925 0 10:32 pts/6 00:00:00 grep --color=auto 15925
foo 15925 15919 0 Nov23 pts/6 00:00:08 -bash
The second column will show the parent process (15925) and the second the parent

No coredump file generated in configured directory sometimes [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I configured one of my Ubuntu1804 user to dump ,
> ulimit -a | grep core
core file size (blocks, -c) unlimited
> cat /proc/sys/kernel/core_pattern
/var/tmp/cores/core.%e.%p.%h.%t.%s
> ls /var/tmp/cores/ -ld
drwxrwxrwx 2 root root 36864 Mar 10 00:05 /var/tmp/cores/
I can get most of the core dumps of crashed process in /var/tmp/cores, but sometimes some crashed process caused by SIGTERM has no coredump file in the directory.
I checked the log of the process missing process, the log said the aborting signal was SIGTERM.
So how came no dump file for it ?
the default action in Linux as described in man 7 signal is to terminate without coredump.
Signal Value Action Comment
────────────────────────────────────────────────────────
SIGTERM 15 Term Termination signal

Difference between pidof and pgrep? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I'm not sure why pidof doesn’t work, but pgrep works.
$ pidof squid
returns nothing
$ pgrep squid
returns 3322
How can I get the 3322 using pidof?
pidof will return details regarding the name of a actual program whereas pgrep will return details regarding any processes that match the provided pattern. This is clearly stated in the man pages of both tools.
pidof [-s] [-c] [-n] [-x] [-m] [-o omitpid[,omitpid..]] [-o omitpid[,omitpid..]..] program [program..]
vs.
pgrep [options] pattern
When you're looking for the executable squid, pgrep can match it because the pattern matches /usr/bin/squid*. Whereas pidof cannot find a program called squid, because the Squid daemon is likely called something like /usr/bin/squid-server.
For example, here I'm looking at the output of ps and looking for programs running with the name systemd within them:
$ ps -eaf | grep systemd
root 1 0 0 Sep03 ? 00:00:05 /usr/lib/systemd/systemd --switched-root --system --deserialize 21
root 425 1 0 Sep03 ? 00:00:03 /usr/lib/systemd/systemd-journald
root 480 1 0 Sep03 ? 00:00:00 /usr/lib/systemd/systemd-udevd
dbus 630 1 0 Sep03 ? 00:00:01 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root 648 1 0 Sep03 ? 00:00:00 /usr/lib/systemd/systemd-logind
pgrep is able to find them as well:
$ pgrep -l systemd
1 systemd
425 systemd-journal
480 systemd-udevd
648 systemd-logind
But pidof only finds the first one:
$ pidof systemd
1
That's because the PID 1, has the name /usr/bin/systemd.

Why is du command showing incorrect results [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
The below output showing 21GB files each.
[root#myhost data]# ls -l
total 100092
-rw-rw---- 1 ora4 ora4 **22548586496** Dec 18 21:09 temp01.dbf
-rw-rw---- 1 ora4 ora4 **22548586496** Dec 18 19:38 temp02.dbf
But when i used du command, its shows only 49MB.
[root#myhost data]# du -sh *
49M temp01.dbf
49M temp02.dbf
Could you please let me know, how to correct the values.
execute the ls -lh ls -l. will display the size in the bytes. du -sh in du command you are mentioning the h for displaying the result in human readable format. If you check with the du it will display the output in kb(kilo bytes). Compare the results with ls -lh and du -sh *.

Resources