LInux 1
4. 파일관련 명령어 정리 Linux
양곰3
2017. 4. 10. 18:28
파일관련 명령어
1. 파일 이동: mv
#>mv <src_path> <dst_path>
원주소 목적지
ex)
#>mv /dir1/file1 /dir2/passwd --> file1의 이름을 passwd로 변경
#>mv /dir2/passwd /dir2/file
#>mv /dir2/file /dir3/
-f --> 묻지않는다
ex)
#>mv -f /dir3/file /root/file2
#>rm -rf /root/*
#>mv /dir1 /root/
#>mv /dir2 /root/
#>mv /dir3 /root/
2. 파일 복사 : cp
#>cp <src_path> <dst_path>
ex)
#>cp /etc/passwd /root/
#>cp /etc/passwd /root/file1
#>cp /root/dir3 /root/dir4
-r
ex)
#>cp -r /root/dir3 /root/dir4