본문 바로가기

Ubuntu/linux Command

Linux Basic Command (mv)

728x90

파일을 이동하는 명령어

 

구문 : mv [옵션] [from 파일 및 디렉토리] [ to 파일 및 디렉토리]

 

 

용례1 : mv test.txt test2.txt

test2.txt 파일이 없는 경우 test.txt 파일을 test2.txt 파일로 이름을 변경

 

 

용례2 : mv test.txt dir

test.txt 파일을 dir 디렉토리로 이동

 

 

용례3 : mv test.txt test2.txt dir

test.txt, test2.txt 파일을 dir 디렉토리로 이동

 

 

용례4 : mv dir1 dir2

dir2 디렉토리가 없을 경우 dir1 디렉토리를 dir2 디렉토리도 이름을 변경

 

 

용례5 : mv *.txt dir1

.txt 확장자를 가진 모든 파일을 dir1 디렉토리로 이동

 

용례6 : mv ../airbnb* . 

상위 directory 의 airbnb 로 이름이 되어있는 모든 directory 를 현재 directory 로 이동한다.

 

'Ubuntu > linux Command' 카테고리의 다른 글

Linux Basic Command (date)  (0) 2021.08.05
Linux Basic Command (rm)  (0) 2021.08.05
Linux Basic Command (cp)  (0) 2021.08.05
Linux Basic Command (find)  (0) 2021.08.05
Linux Basic Command (mkdir/rmdir)  (0) 2021.08.05