CDM - chwon 명령어 사용법
파일 소유자 및 그룹 변경
실 사용 환경에서 필요한 내용만 정리.
Test environment
OS : CentOS 7 3.10.0-957.el7.x86_64
주요 내용
A file's owner can be changed using the chown command.
chown [OPTION]... [OWNER][:[GROUP]] FILE...
- chown 을 이용해서 파일 및 디렉토리 사용자, 그룹 변경
[root@localhost sw]# chown -R root:root *
[root@localhost sw]# ls -alrt
total 8
dr-xr-xr-x. 18 root root 234 Feb 5 01:49 ..
drwxrwxrwx. 2 root root 6 Feb 5 01:49 img
drwx------. 2 root root 6 Feb 5 01:49 was
drwx------. 2 root root 6 Feb 5 01:49 web
drwxr-xr-x. 2 root root 6 Feb 5 01:49 app
drwxr-xr-x. 2 root root 6 Feb 5 01:49 java
drwxr-xr-x. 2 root root 6 Feb 5 01:49 bin
drwxr-xr-x. 2 root root 6 Feb 7 21:26 logs
-rwxr-xr-x. 1 root root 428 Feb 8 01:16 Mem.sh
-rwxr-xr-x. 1 root root 446 Feb 8 06:01 Mem1.sh
drwxr-xr-x. 9 root root 114 Feb 8 06:01 .
[root@localhost sw]# chown wasadm:wasadm img
[root@localhost sw]# chown wasadm:wasadm was
[root@localhost sw]# chown wasadm:wasadm Mem.sh
[root@localhost sw]# ls -alrt
total 8
dr-xr-xr-x. 18 root root 234 Feb 5 01:49 ..
drwxrwxrwx. 2 wasadm wasadm 6 Feb 5 01:49 img
drwx------. 2 wasadm wasadm 6 Feb 5 01:49 was
drwx------. 2 root root 6 Feb 5 01:49 web
drwxr-xr-x. 2 root root 6 Feb 5 01:49 app
drwxr-xr-x. 2 root root 6 Feb 5 01:49 java
drwxr-xr-x. 2 root root 6 Feb 5 01:49 bin
drwxr-xr-x. 2 root root 6 Feb 7 21:26 logs
-rwxr-xr-x. 1 wasadm wasadm 428 Feb 8 01:16 Mem.sh
-rwxr-xr-x. 1 root root 446 Feb 8 06:01 Mem1.sh
drwxr-xr-x. 9 root root 114 Feb 8 06:01 .
0 Comments:
댓글 쓰기