728x90
반응형

1. UiD GID를 확인
명령어 : id, cat  /etc/passwd

- 방법 1 -
$ id
uid=1000(admin) gid=1000(admin) groups=1000(admin),10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

- 방법 2 -
$ grep admin /etc/passwd
admin:x:1000:1000:admin:/home/admin:/bin/bash


2. /var/mail형식
명령어 : ls -al /var/mail
           file /var/mail

- 방법 1 -
$ ls -F /var/mail
/var/mail@

- 방법 2 -
$ ls -l /var/mail
lrwxrwxrwx. 1 root root 10 Jun 29  2020 /var/mail -> spool/mail

- 방법 3 -
$ file /var/mail
/var/mail: symbolic link to `spool/mail'

 심볼릭 링크 파일이며 원본은 /var/spool/mail 임.


3. /var/mail의 원본파일의 소유자를 확인하시오.
명령어 : ls -ld /var/spool/mail

$ ls -ld /var/spool/mail
drwxrwxr-x. 2 root mail 45 May 24 15:40 /var/spool/mail

소유자 root , 소유그룹 mail


4. /var/log/dmesg.old 의 파일 형식과 size를 확인하시오.
명령어 : ls -l /var/log/dmesg.old

- 방법 1 -
$ ls -l /var/log/dmesg.old
-rw-r--r--. 1 root root 32333 May 25 09:16 /var/log/dmesg.old

- 방법 2 -
$ file /var/log/dmesg.old
/var/log/dmesg.old: ASCII text

ASCII text 파일이며, size는 32,333byte


5. /dev/tty의 파일 형식과 마지막 사용날짜&시간을 확인
명령어 : ls -l /dev/tty

$ ls -l /dev/tty
crw-rw-rw-. 1 root tty 5, 0 May 25 10:00 /dev/tty

5월25일 오전 10시가 마지막 사용날짜및시간임.


6.  /etc/init.d 디렉토리 내의 파일들을 간단히  file type을 사용하여 목록을 확인하라.
명령어 : ls -F /etc/init.d

- 방법 1 -
$ ls -F /etc/init.d
/etc/init.d@

- 방법 2 -
$ ls -l /etc/init.d
lrwxrwxrwx. 1 root root 11 Jun 29  2020 /etc/init.d -> rc.d/init.d


7. ~user/0524 홈디렉토리 내에서 아래와 같이 디렉토리를  생성하시오.
fruit / apple, banana, fineapple, kiwi
juice / strawberries, watermelon
tropics / avocado, durian

- 방법 1 -
$ cd ~/0524
$ mkdir fruit juice tropics
$ cd fruit 
$ mkdir apple banana fineapple kiwi
$ cd ../juice
$ mkdir strawberries watermelon
$ cd ../tropics
$ mkdir abocado durian

- 방법 2 -
$ cd ~/0524
$ 
mkdir -p fruit/apple fruit/banana fruit/fineapple fruit/kiwi
$ 
mkdir -p juice/strawberries juice/watermelon
$ 
mkdir -p tropics/abocado  tropics/durian

ls -R ~user/0524 로 확인


8.fineapple  하위에 salad 파일 생성

$ touch ~user/0524/fruit/fineapple/salad


9.durian 밑에 ice 디렉토리 생성

$ mkdir ~user/0524/tropics/durian/ice


10.kiwi에서 avocado 하위로 절대 경로로 작업디렉토리를 이동하시오.

$ cd /home/user/0524/tropics/avocado


11. avocado 하위에서 watermelon 하위로   상대경로로 작업디렉토리를 이동하시오.

$ cd ../juice/watermelon


12./home/user/fruit/banana 디렉토리내에  ice 파일을 생성 하시오.

- 방법 1 - 
$ touch /home/user/fruit/banana/ice

- 방법 2 -
$ touch ~/0524/fruit/banana/ice


13.juice 디렉토리를 tropics 디렉토리 밑으로 복사하시오.

$ cp -r ~user/0524/juice ~user/0524/tropics


14. durian디렉토리를  strawberries 이동하시오.

- 방법 1 -
$ 
mv ~user/0524/tropics/durian ~user/0524/juice/strawberries

- 방법 2 -
$ cd ~usr/0524
$ 
mv tropics/durian  juice/strawberries


15 ~user/0524 디렉토리를 모든 하위 디렉토리를 확인하시오.

$ ls -R ~user/0524 | more


16./dev/null 은 어떤 장치 파일인가?

- 방법 1 -
$ ls -l /dev/null
crw-rw-rw-. 1 root root 1, 3 May 25 10:00 /dev/null

- 방법 2 -
$ file /dev/null
/dev/null: character special   캐릭터장치파일 (1문자씩 처리하는 장치파일)


17. /etc/yum.repos.d/CentOS-Base.repo 파일은 어떤 종류의 파일이며, 몇개의 라인으로 구성되어 있는가?

- 방법 1 -
$ file /etc/yum.repos.d/CentOS-Base.repo

- 방법 2 -
$ 
wc /etc/yum.repos.d/CentOS-Base.repo

- 방법 3 -
$ wc -l /etc/yum.repos.d/CentOS-Base.repo


18. /etc/yum.repos.d/CentOS-Base.repo 파일을 more로 확인하시오. 그리고 more에서 ‘plus’ 패턴을 검색하시오.

$ more /etc/yum.repos.d/CentOS-Base.repo

$ /plus


19. /etc/yum.repos.d/CentOS-Base.repo 파일의 37번 라인부터 끝까지 출력하시오.

$ tail -n +37 /etc/yum.repos.d/CentOS-Base.repo


20. rpm 명령어가 어느 경로에 있는지 찾아서 파일종류를 확인하시오.

- 방법 1 -
$
 which rpm 
           /usr/bin/rpm

- 방법 2 -
$ ls -l /usr/bin/rpm

- 방법 3 -
$ ls -l /usr/bin/rpm
-rwxr-xr-x. 1 root root 16128 Apr  1  2020 /usr/bin/rpm

- 방법 4 -
$ ls -F /usr/bin/rpm
         /usr/bin/rpm*

- 방법 5 -
$ file /usr/bin/rpm
/usr/bin/rpm: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=300b96b585ef369ad9a486e4072b0e19f041cbda, stripped


21. fineapple을 pineapple로 이름변경하시오.

$ mv ~user/0524/fruit/fineapple ~user/0524/fruit/pineapple

 

 

 


정온 Tistory

이 티스토리는 학생이 제작하고 있습니다
수정사항이 있다면 댓글이나 방명록에 남겨주세요

728x90
반응형
정온 (jeong on)