ETC/자격증

[리눅스마스터]제1702회 리눅스마스터 1급 2차 시험 단답식 풀이 1

AnKiWoong 2022. 4. 5. 12:19
반응형

1. 다음은 특수권한 설정에 관한 명령어 이다. ( 괄호 ) 안에 알맞은 옵션을 넣으시오.

[root@ihd ~]# chmod ( 괄호 ) /ihd

<조  건>
- 일반 사용자들이 /ihd 디렉터리에서 파일 및 디렉터리 생성이 가능하다.
- 일반 사용자들은 자신이 생성한 파일 및 디렉터리 이외에는 수정 및 삭제가 불가능하다.
- 기존에 설정된 /ihd 디렉터리의 허가권(Permission)값에 상관없이 적용되도록 설정한다.

 

[root@server1 ~]# man chmod
RESTRICTED DELETION FLAG OR STICKY BIT
       The restricted deletion flag or sticky bit is a single bit, whose interpretation  depends  on  the  file
       type.  For directories, it prevents unprivileged users from removing or renaming a file in the directory
       unless they own the file or the directory; this is called the restricted deletion flag  for  the  direc‐
       tory,  and  is  commonly found on world-writable directories like /tmp.  For regular files on some older
       systems, the bit saves the program's text image on the swap device so it will  load  more  quickly  when
       run; this is called the sticky bit.

 

sticky bit : 특정 디렉토리의 경우 공유의 목적으로 사용 할 때 사용자들에 의해 파일이 생성 될 수 있으나 디렉토리에 파일을 마음대로 삭제 할 수 없음.

 

[root@server1 ~]# ls -ld /tmp
drwxrwxrwt. 15 root root 4096 Apr  5 12:00 /tmp

 

[root@server1 ~]# mkdir /public
[root@server1 ~]# ls -ld /public/
drwxr-xr-x. 2 root root 6 Apr  5 12:05 /public/
[root@server1 ~]# chmod 1777 /public/
[root@server1 ~]# ls -ld /public/
drwxrwxrwt. 2 root root 6 Apr  5 12:05 /public/

 

1777

 

2. 다음은 파일 시스템 생성한 후에 관련 정보를 확인하는 과정이다. ( 괄호 ) 안에 알맞은 순서를 넣으시오.

[root@ihd ~]# mke2fs ( ① ) ext4 ( ② ) 1024 /dev/sdb1
[root@ihd ~]# ( ③ ) /dev/sdb1

<조  건>
- /dev/sdb1 디바이스의 블록 사이즈 단위를 1024byte로 지정하고 ext4 파일시스템으로 생성한다.
- 생성된 파일시스템의 블록 사이즈 정보를 확인한다.

 

mke2fs : 파일 시스템 생성 명령어

dumpe2fs  : 파일 시스템 구조 확인(파일시스템의 meta-data 확인)

 

[root@server1 ~]# man mke2fs
Usage: mke2fs [-c|-l filename] [-b block-size] [-C cluster-size]
        [-i bytes-per-inode] [-I inode-size] [-J journal-options]
        [-G flex-group-size] [-N number-of-inodes]
        [-m reserved-blocks-percentage] [-o creator-os]
        [-g blocks-per-group] [-L volume-label] [-M last-mounted-directory]
        [-O feature[,...]] [-r fs-revision] [-E extended-option[,...]]
        [-t fs-type] [-T usage-type ] [-U UUID] [-jnqvDFKSV] device [blocks-count]
SEE ALSO
       mke2fs.conf(5), badblocks(8), dumpe2fs(8), e2fsck(8), tune2fs(8), ext4(5)

 

[root@server1 ~]# man dumpe2fs
SYNOPSIS
       dumpe2fs [ -bfhixV ] [ -o superblock=superblock ] [ -o blocksize=blocksize ] device

 

① -t
② -b
③ dumpe2fs

 

 

 

3. 다음은 프로세스 관리에 관한 명령어 이다. ( 괄호 ) 안에 알맞은 옵션을 넣으시오.

[root@ihd ~]# top
top - 08:45:47 up 42 min, 1 user, load average: 0.00, 0.00, 0.00
Tasks: 171 total, 1 running, 169 sleeping, 1 stopped, 1 zombie
Cpu(s): 0.0%us, 0.3%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1907936k total, 372188k used, 1535748k free, 32704k buffers
Swap: 2097148k total, 0k used, 2097148k free, 145660k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3535 root 20 0 15040 1284 936 R 0.7 0.1 0:00.06 top
7 root 20 0 0 0 0 S 0.3 0.0 0:04.54 events/0
2046 root 20 0 8368 416 312 S 0.3 0.0 0:00.03 fcoemon
2258 root 20 0 22520 1112 940 S 0.3 0.1 0:01.15 hald-addon-stor
3318 root 20 0 102m 4604 3540 Z 0.3 0.2 0:00.52 hackd
1 root 20 0 19360 1548 1232 S 0.0 0.1 0:00.96 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
[root@ihd ~]# kill ( ① ) ( ② )

<조  건>
- top 명령을 통해 zombie 프로세스를 확인한다.
- top 명령을 통해 확인한 zombie 프로세스를 강제로 종료하는 시그널을 보낸다.

 

top : 실시간 모니터링

kill : 프로세스 강제 종료

 

[root@server1 ~]# man top
S  --  Process Status
           The status of the task which can be one of:
               D = uninterruptible sleep
               R = running
               S = sleeping
               T = traced or stopped
               Z = zombie

 

[root@server1 ~]# top
Tasks: 393 total,   1 running, 392 sleeping,   0 stopped,   0 zombie
%Cpu(s):  1.0 us,  1.5 sy,  0.0 ni, 97.4 id,  0.0 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem:   3869044 total,   603764 used,  3265280 free,     1076 buffers
KiB Swap:  4079612 total,        0 used,  4079612 free.   223912 cached Mem

   PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
  4346 root      20   0  124128   1808   1100 R   9.5  0.0   0:00.08 top
   138 root      20   0       0      0      0 S   4.8  0.0   0:00.71 rcuos/0
     1 root      20   0  126480   7144   3940 S   0.0  0.2   0:03.65 systemd
     2 root      20   0       0      0      0 S   0.0  0.0   0:00.02 kthreadd
     3 root      20   0       0      0      0 S   0.0  0.0   0:00.04 ksoftirqd/0
     5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:0H
     7 root      rt   0       0      0      0 S   0.0  0.0   0:00.05 migration/0
     8 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcu_bh
     9 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/0
    10 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/1
    11 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/2
    12 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/3
    13 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/4
    14 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/5
    15 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/6
    16 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/7
    17 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/8
    18 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/9
    19 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/10
    20 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/11
    21 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/12
    22 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/13
    23 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/14
    24 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/15
    25 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/16
    26 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/17
    27 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/18
    28 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/19
    29 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/20
    30 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/21
    31 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/22
    32 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/23
    33 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/24
    34 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/25
    35 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/26
    36 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/27
    37 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/28
    38 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/29
    39 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/30
    40 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/31
    41 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/32
    42 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/33
    43 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/34
    44 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/35
    45 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/36
    46 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/37
    47 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/38
    48 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/39
    49 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/40
    50 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/41
    51 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/42
    52 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/43

 

① -9
② 3318

반응형