PS
-
리눅스 환경에서 아래 이미지와 같은 shell 스크립트를 통한 텍스트 모니터링 유틸리티를 만들어 보겠습니다. 스크립트 레이아웃 echo 명령를 통해 레이아웃을 구분할 수 있습니다. [root@d86a1cc708f1 ~]# line="###############################################################" [root@d86a1cc708f1 ~]# echo "$line" ############################################################### [root@d86a1cc708f1 ~]# line="---------------------------------------------------------------" [root@d86..
리눅스 모니터링 스크립트리눅스 환경에서 아래 이미지와 같은 shell 스크립트를 통한 텍스트 모니터링 유틸리티를 만들어 보겠습니다. 스크립트 레이아웃 echo 명령를 통해 레이아웃을 구분할 수 있습니다. [root@d86a1cc708f1 ~]# line="###############################################################" [root@d86a1cc708f1 ~]# echo "$line" ############################################################### [root@d86a1cc708f1 ~]# line="---------------------------------------------------------------" [root@d86..
2022.11.21 -
ps 명령어를 수행하면 user name이 짤려서 출력 되어 grep을 하면 원하는 결과가 나오지 않는다. [root@junsu-desktop ~]docker_host# cat /etc/passwd aaaaaaaaaaaaaaaaaa:x:1002:1002::/home/aaaaaaaaaaaaaaaaaa:/bin/sh [root@junsu-desktop ~]docker_host# ps -ef |grep top aaaaaaa+ 2653915 2653912 0 01:39 pts/3 00:00:00 top root 2653924 2653776 0 01:39 pts/2 00:00:00 grep --color=auto top ps 결과 출력 포맷 변경 ps -eo 옵션을 사용하여 유저명이 짤리지 않게 출력 합니다. [..
ps 명령어 수행 시 user name 짤림ps 명령어를 수행하면 user name이 짤려서 출력 되어 grep을 하면 원하는 결과가 나오지 않는다. [root@junsu-desktop ~]docker_host# cat /etc/passwd aaaaaaaaaaaaaaaaaa:x:1002:1002::/home/aaaaaaaaaaaaaaaaaa:/bin/sh [root@junsu-desktop ~]docker_host# ps -ef |grep top aaaaaaa+ 2653915 2653912 0 01:39 pts/3 00:00:00 top root 2653924 2653776 0 01:39 pts/2 00:00:00 grep --color=auto top ps 결과 출력 포맷 변경 ps -eo 옵션을 사용하여 유저명이 짤리지 않게 출력 합니다. [..
2022.11.06 -
ps 유틸리티 설치 ps CentOS [root@36db4f37d7cd /]# yum install -y procps Ubuntu root@2e7d55ea6f88:/# apt-get install -y procps 패키지 매니저로 설치가 불가능한 경우 아래 링크를 통해 직접 파일로 다운 받아 설치 합니다. Linux package / utility / libarary 파일 다운로드 리눅스 환경에서 yum 또는 apt-get과 같은 패키지 관리자로 패키지를 다운 받지 못할 때 파일로 준비해야 합니다. package, utility, librarary Repository CentOS Index of /centos mirror.navercorp.com CentOS.. junsuyoun.tistory.com
ps: command not foundps 유틸리티 설치 ps CentOS [root@36db4f37d7cd /]# yum install -y procps Ubuntu root@2e7d55ea6f88:/# apt-get install -y procps 패키지 매니저로 설치가 불가능한 경우 아래 링크를 통해 직접 파일로 다운 받아 설치 합니다. Linux package / utility / libarary 파일 다운로드 리눅스 환경에서 yum 또는 apt-get과 같은 패키지 관리자로 패키지를 다운 받지 못할 때 파일로 준비해야 합니다. package, utility, librarary Repository CentOS Index of /centos mirror.navercorp.com CentOS.. junsuyoun.tistory.com
2022.10.11 -
linux 프로세스별 CPU 사용량 결과 원하는 대로 출력 해보기 원하는 형태로 프로세스 정보 출력 $ ps -eo user,pid,pcpu,cmd USER PID %CPU CMD root 1 0.0 /sbin/init splash root 2 0.0 [kthreadd] root 3 0.0 [rcu_gp] root 4 0.0 [rcu_par_gp] root 5 0.0 [netns] root 7 0.0 [kworker/0:0H-events_highpri] root 9 0.0 [kworker/0:1H-kblockd] root 10 0.0 [mm_percpu_wq] root 11 0.0 [rcu_tasks_rude_] root 12 0.0 [rcu_tasks_trace] root 13 0.0 [ksoftirq..
linux 프로세스별 CPU 사용량 결과 원하는 대로 출력linux 프로세스별 CPU 사용량 결과 원하는 대로 출력 해보기 원하는 형태로 프로세스 정보 출력 $ ps -eo user,pid,pcpu,cmd USER PID %CPU CMD root 1 0.0 /sbin/init splash root 2 0.0 [kthreadd] root 3 0.0 [rcu_gp] root 4 0.0 [rcu_par_gp] root 5 0.0 [netns] root 7 0.0 [kworker/0:0H-events_highpri] root 9 0.0 [kworker/0:1H-kblockd] root 10 0.0 [mm_percpu_wq] root 11 0.0 [rcu_tasks_rude_] root 12 0.0 [rcu_tasks_trace] root 13 0.0 [ksoftirq..
2022.10.04 -
linux에서 ps 명령을 통해 프로세스별 CPU 사용량 확인해보기 ps -aux --sort -pcpu $ ps -aux --sort -pcpu|more USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1014 0.1 0.1 2085844 49692 ? Ssl Oct02 3:37 /usr/bin/containerd root 5678 0.1 1.8 15310052 738596 pts/0 Ssl+ Oct02 5:30 java -Dspring.profiles.active=prod -jar app.jar root 1 0.0 0.0 167908 11636 ? Ss Oct02 0:11 /sbin/init splash root 2 0.0 0.0 0 0 ? ..
linux 프로세스별 CPU 사용량 확인linux에서 ps 명령을 통해 프로세스별 CPU 사용량 확인해보기 ps -aux --sort -pcpu $ ps -aux --sort -pcpu|more USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1014 0.1 0.1 2085844 49692 ? Ssl Oct02 3:37 /usr/bin/containerd root 5678 0.1 1.8 15310052 738596 pts/0 Ssl+ Oct02 5:30 java -Dspring.profiles.active=prod -jar app.jar root 1 0.0 0.0 167908 11636 ? Ss Oct02 0:11 /sbin/init splash root 2 0.0 0.0 0 0 ? ..
2022.10.04