[linux] sleep, wait

Han Hanju·2022년 1월 5일
0
post-thumbnail

1. sleep

  • 프로세스에서 정해준 시간만큼 잠시 멈춤
[root@centos77 ~]# sleep 3

# 여기서 3초간 정지

[root@centos77 ~]# sleep 3&

[1] 5204

[root@centos77 ~]#

[1]+ Done sleep 3

[root@centos77 ~]#

2. wait

  • 프로세스들의 작업이 끝나기를 기다림
[root@centos77 ~]# sleep 10 &

[1] 5205

[root@centos77 ~]# sleep 20&

[2] 5214

[root@centos77 ~]# sleep 30&

[3] 5216

[root@centos77 ~]# wait %1 %2 %3

[1] Done sleep 10

[2]- Done sleep 20

[3]+ Done sleep 30

[root@centos77 ~]#

reference

https://mns010.tistory.com/8

profile
Data Analytics Engineer

0개의 댓글