Notice
														
												
											
												
												
													Recent Posts
													
											
												
												
													Recent Comments
													
											
												
												
													Link
													
											
									| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 | 
| 12 | 13 | 14 | 15 | 16 | 17 | 18 | 
| 19 | 20 | 21 | 22 | 23 | 24 | 25 | 
| 26 | 27 | 28 | 29 | 30 | 31 | 
													Tags
													
											
												
												- rsyslog
- 디렉토리
- RHEL
- audit
- 빅데이터
- PostgreSQL
- Chrome
- Elasticsearch
- GPU
- docker
- centos 7.5
- yum
- Shell
- Elk
- CentOS
- Kubernetes
- 크롬
- C
- bash
- Audit Log
- 파이썬
- log
- Linux
- 서울시민카드
- syslog
- JSON
- zabbix
- GNOME
- K8S
- Python
													Archives
													
											
												
												- Today
- Total
Sysops Notepad
[bash] 쉘 스크립트 디렉토리 or 파일 존재 여부 확인하는 법 본문
728x90
    
    
  linux bash shell script  directory , file check 하는 방법
#!/bin/bash
# 디렉토리 존재 유무 확인
If [ ! -d 디렉토리명 ] ; then
 mkdir 디렉토리명
fI
# 파일 존재 유무 확인
If [ ! -e 디렉토리명 ] ; then
 touch 파일명
fI
728x90
    
    
  '업무 > dev' 카테고리의 다른 글
| [Python] Anaconda 설치 및 사용 방법 (0) | 2018.11.14 | 
|---|---|
| [Python] OS 모듈 및 스크립트 작성에 많이 쓰이는 모듈 (0) | 2018.11.10 | 
| Elasticsearch & Slack 연동을 통한 로그 모니터링 하기 (0) | 2018.10.24 | 
| [bash] 쉘 디렉토리 유무 판단하기 (0) | 2018.09.29 | 
| [bash] 쉘 반복문 사용하기 (0) | 2018.09.29 | 
			  Comments