반응형
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
- chmod
- permission
- MSBing
- yum
- 같은폴더
- pvcreate
- newbingai
- 리다이렉션
- docker image
- ssh
- 날짜변경
- docker network
- 엑셀파일명변경
- Kubernetes
- vagrant kubernetes
- vgcreate
- mount
- firewalld
- lvcreate
- M365필터
- nmcli
- chatGPT
- swapon
- 랜카드인식불량
- HTTPD
- journalctl
- docker
- 프로세스
- ansible
- tar
Archives
- Today
- Total
becool
date 표현 본문
반응형
$ date -option -format
포맷
YYYYMMDD
[user@localhost 20210414]$ date +%G%m%d
20210414
[user@localhost 20210414]$ date +%F
2021-04-14
[user@localhost 20210414]$ date +%y%m%d
210414
[user@localhost 20210414]$ date +%Y%m%d
20210414
[user@localhost 20210414]$ touch $(date +%F).txt
[user@localhost 20210414]$ ls
2021-04-14.txt
[user@localhost 20210414]$ ls -l /etc >> ./list$(date +%G%m%d).txt
[user@localhost 20210414]$ ls
list20210414.txt
$(date)
※ `` 역 홑따옴표와 $() 달러표시
[user@localhost 20210414]$ echo today is `date +%Y%m%d` → 범용
today is 20210414
[user@localhost 20210414]$ echo today is $(date +%Y%m%d) → bash 쉘에서만 가능함
today is 20210414
728x90
'linux' 카테고리의 다른 글
20210415 (목) (0) | 2021.04.15 |
---|---|
20210414 (수) (0) | 2021.04.14 |
20210413 (화) (0) | 2021.04.13 |
20210412 (월) (0) | 2021.04.12 |
20210409 (금) (0) | 2021.04.09 |
Comments