1. ~/0602/down 디렉토리를 생성하시오.
mkdir -p ~/0602/down
2. ~/0602/down 디렉토리에 test1, test2 파일을 생성 하시오
touch ~/0602/down/test1 ~/0602/down/test2
3. ~/0602/down 디렉토리에 있는 test1, test2 파일을 각각 test3, test4 파일로 /tmp 디렉토리에 복사하시오.
(test1 => test3, test2 => test4)
cp ~/0602/down/test1 /tmp/test3
cp ~/0602/down/test2 /tmp/test4
4. ~/0602/down 디렉토리에 test 디렉토리를 생성하시오.
mkdir ~/0602/down/test
5. ~/0602/down/test 디렉토리를 /tmp 디렉토리로 이동 하시오
mv ~/0602/down/test /tmp
6.find 명령어를 통해 /tmp 디렉토리내에 파일명 앞부분에 “test”문자열이 섞인 파일을 검색하면서 삭제 하시오.
find /tmp -name "test*" -exec rm -r {} \;
7.find 명령어를 통해 /etc/group 파일을 찾아서 ~/0602 디렉토리에 복사하시오.
find /etc/ -name "group" -exec cp -r {} ~/0602\;
8.find 명령어를 통해 ~/0602/group 파일을 찾아서 삭제하시오.(단 대화형으로)
find ~/0602/ -name "group" -exec rm -rf {} \;
9.find 명령어를 통해서 / 내에서 소유자가 user인 파일들을 모두 찾아서 자세하게 출력하시오.
find / -user user -ls
10.find 명령어를 통해서 /tmp 내에서 소유자가 user인 파일을 찾아서 삭제 하시오.
find /tmp -user user -exec rm -rf {} \;
find /tmp -user user -delete
find 실습
1. ~/0602/down 디렉토리를 생성하시오.
mkdir ~/0602/down
2. ~/0602/down 디렉토리에 test1, test2 파일을 생성 하시오
touch ~/0602/down/test1 ~/0602/down/test2
3. ~/0602/down 디렉토리에 있는 test1, test2 파일을 각각 test3, test4 파일로 /tmp 디렉토리에 복사하시오.
(test1 => test3, test2 => test4)
cp ~/0602/down/test1 /tmp/test3
cp ~/0602/down/test2 /tmp/test4
4. ~/0602/down 디렉토리에 test 디렉토리를 생성하시오.
mkdir ~/0602/down/test
5. ~/0602/down/test 디렉토리를 /tmp 디렉토리로 이동 하시오
mv ~/0602/down/test /tmp
6. find 명령어를 통해 /tmp 디렉토리내에 파일명 앞부분에 “test”문자열이 섞인 파일을 검색하면서 삭제 하시오.
find /tmp -name "test*" -exec rm -r {} \;
7.find 명령어를 통해 /etc/group 파일을 찾아서 /root/ 디렉토리에 복사하시오.
find /etc/ -name "group" -exec cp -r {} /root/ \;
8.find 명령어를 통해 ~/0602/group 파일을 찾아서 삭제하시오.(단 대화형으로)
find ~/0602 -name "group" -ok rm -r {} \;
9.find 명령어를 통해서 / 내에서 소유자가 user 인 파일들을 모두 찾아서 자세하게 출력하시오.
find / -user user -ls
or
find / -user user -exec ls -ild {} \;
10.find 명령어를 통해서 /tmp 내에서 소유자가 user인 파일을 찾아서 삭제 하시오.
find /tmp -user user -exec rm -r {} \;
'Linux' 카테고리의 다른 글
Linux리눅스 연습문제 - 기초5 ( 권한연습 ) (0) | 2023.06.07 |
---|---|
Linux리눅스 연습문제 - 기초5 (0) | 2023.06.05 |
Linux리눅스 연습문제 - 기초3 (0) | 2023.06.04 |
Linux리눅스 연습문제 - 기초2 (0) | 2023.06.04 |
리눅스 연습문제 - 기초1 (0) | 2023.06.01 |