일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 솔라리스
- 리눅스
- ext3
- PORT
- Hack
- rm
- rm -rf
- http
- 쇼펜의상속자 #킨텍스메가쇼 #섬유향수탈취제
- Disk
- 디스크
- Cache
- PERL
- Linux
- apachetop
- windows
- Python
- Bash
- iptables
- ext4
- CPU
- 좌절교육
- goaccess
- 칭찬교육
- Performance
- cadre
- DNS
- Kernel
- rsync
- pid
- Today
- Total
Ben's
mv --strip-trailing-slashes 옵션 소개 본문
--strip-trailing-slashes remove any trailing slashes from each SOURCE
argument
================================================
★ --strip-trailing-slashes 옵션 미사용시: txt를 디렉토리로 인식하여 링크 걸린 /하위 파일들을 /home/test1 아래로 move 시켜버림(심각한 문제 발생!!)
[root@pdns-test03 test]# mkdir /home/test1
[root@pdns-test03 test]# pwd
/root/test
[root@pdns-test03 test]# ls
txt@
[root@pdns-test03 test]# mv -v txt/ /home/test1
`txt/' -> `/home/test1/txt'
`txt/disk2' -> `/home/test1/txt/disk2'
`txt/dev' -> `/home/test1/txt/dev'
`txt/dev/vcs6' -> `/home/test1/txt/dev/vcs6'
`txt/dev/vcsa4' -> `/home/test1/txt/dev/vcsa4'
`txt/dev/vcs4' -> `/home/test1/txt/dev/vcs4'
`txt/dev/vcsa5' -> `/home/test1/txt/dev/vcsa5'
`txt/dev/vcsa6' -> `/home/test1/txt/dev/vcsa6'
`txt/dev/vcs5' -> `/home/test1/txt/dev/vcs5'
`txt/dev/vcs3' -> `/home/test1/txt/dev/vcs3'
`txt/dev/vcsa2' -> `/home/test1/txt/dev/vcsa2'
`txt/dev/vcs2' -> `/home/test1/txt/dev/vcs2'
...
★ --strip-trailing-slashes 옵션 사용시: txt를 /를 뺀 파일로 인식하여 /home/test2 아래로 링크 그대로 move 시킴.(안전함)
[root@pdns-test03 test]# mkdir -p /home/test2
[root@pdns-test03 test]# mv -v --strip-trailing-slashes txt/ /home/test2
`txt' -> `/home/test2/txt'
removed `txt'
[root@pdns-test03 test]# ls /home/test2
txt@
'리눅스' 카테고리의 다른 글
thttpd config (0) | 2013.04.16 |
---|---|
rm --preserve-root 옵션 소개 (0) | 2013.04.08 |
성능 튜닝 (0) | 2013.01.21 |
lsyncd(실시간 파일 동기화) (0) | 2013.01.21 |
vim에서 윈도 개행문자(^M) 삭제하기 (0) | 2013.01.21 |