본문 바로가기

ETC/자격증

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

반응형

1. 다음은 사용자 그룹에 관련된 명령어이다. ( 괄호 ) 안에 알맞은 옵션을 넣으시오.

[root@ihd ~]# useradd ( ① ) /home/ihd ( ② ) linuxmaster ihd

<조  건>
- 사용자 ID는 ihd, 홈디렉터리는 /home/ihd 인 사용자를 생성한다.
- 기본그룹은 ihd, 추가(2차그룹)는 linuxmaster 이다.

 

useradd : 사용자 정보 추가

-G : 2차 그룹 지정

-d : 사용자 홈디렉터리 지정

 

[root@server1 ~]# useradd -help
Usage: useradd [options] LOGIN
       useradd -D
       useradd -D [options]

Options:
  -b, --base-dir BASE_DIR       base directory for the home directory of the
                                new account
  -c, --comment COMMENT         GECOS field of the new account
  -d, --home-dir HOME_DIR       home directory of the new account
  -D, --defaults                print or change default useradd configuration
  -e, --expiredate EXPIRE_DATE  expiration date of the new account
  -f, --inactive INACTIVE       password inactivity period of the new account
  -g, --gid GROUP               name or ID of the primary group of the new
                                account
  -G, --groups GROUPS           list of supplementary groups of the new
                                account
  -h, --help                    display this help message and exit
  -k, --skel SKEL_DIR           use this alternative skeleton directory
  -K, --key KEY=VALUE           override /etc/login.defs defaults
  -l, --no-log-init             do not add the user to the lastlog and
                                faillog databases
  -m, --create-home             create the user's home directory
  -M, --no-create-home          do not create the user's home directory
  -N, --no-user-group           do not create a group with the same name as
                                the user
  -o, --non-unique              allow to create users with duplicate
                                (non-unique) UID
  -p, --password PASSWORD       encrypted password of the new account
  -r, --system                  create a system account
  -R, --root CHROOT_DIR         directory to chroot into
  -s, --shell SHELL             login shell of the new account
  -u, --uid UID                 user ID of the new account
  -U, --user-group              create a group with the same name as the user
  -Z, --selinux-user SEUSER     use a specific SEUSER for the SELinux user mapping

 

① -d

② -G

 

2. 다음은 파티션 설정에 관한 명령어이다. ( 괄호 ) 안에 알맞은 순서를 넣으시오.

[root@ihd ~]# fdisk /dev/sdb
Command (m for help): ( ① )
e expended
p primary partition (1-4)
... 생략
Command (m for help): p
Device Boot Start End Blocks Id System
/dev/sdb1 1 130 1044193+ 83 Linux
Command (m for help): t
Device Boot Start End Blocks Id System
/dev/sdb1 1 130 1044193+ 83 Linux
Selected partition 1
Hex code (type L to list codes): ( ② )

<조  건>
- /dev/sdb 디바이스를 fdisk 명령어로 /dev/sdb1 파티션으로 생성한다.
- 생성된 리눅스 파티션 속성을 Linux LVM 파티션으로 변경한다.

 

Command (m for help): help

Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   g   create a new empty GPT partition table
   G   create an IRIX (SGI) partition table
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

 

Command (m for help): n
Partition type:
   p   primary (2 primary, 0 extended, 2 free)
   e   extended

 

Command (m for help): l

 0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris
 1  FAT12           27  Hidden NTFS Win 82  Linux swap / So c1  DRDOS/sec (FAT-
 2  XENIX root      39  Plan 9          83  Linux           c4  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
 4  FAT16 <32M      40  Venix 80286     85  Linux extended  c7  Syrinx
 5  Extended        41  PPC PReP Boot   86  NTFS volume set da  Non-FS data
 6  FAT16           42  SFS             87  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS/exFAT 4d  QNX4.x          88  Linux plaintext de  Dell Utility
 8  AIX             4e  QNX4.x 2nd part 8e  Linux LVM       df  BootIt
 9  AIX bootable    4f  QNX4.x 3rd part 93  Amoeba          e1  DOS access
 a  OS/2 Boot Manag 50  OnTrack DM      94  Amoeba BBT      e3  DOS R/O
 b  W95 FAT32       51  OnTrack DM6 Aux 9f  BSD/OS          e4  SpeedStor
 c  W95 FAT32 (LBA) 52  CP/M            a0  IBM Thinkpad hi eb  BeOS fs
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a5  FreeBSD         ee  GPT
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a6  OpenBSD         ef  EFI (FAT-12/16/
10  OPUS            55  EZ-Drive        a7  NeXTSTEP        f0  Linux/PA-RISC b
11  Hidden FAT12    56  Golden Bow      a8  Darwin UFS      f1  SpeedStor
12  Compaq diagnost 5c  Priam Edisk     a9  NetBSD          f4  SpeedStor
14  Hidden FAT16 <3 61  SpeedStor       ab  Darwin boot     f2  DOS secondary
16  Hidden FAT16    63  GNU HURD or Sys af  HFS / HFS+      fb  VMware VMFS
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid fe  LANstep
1c  Hidden W95 FAT3 75  PC/IX           be  Solaris boot    ff  BBT

 

① n

② 8e

 

3. 다음은 프로세스 우선순위에 관한 명령어이다. ( 괄호 ) 안에 알맞은 명령어를 넣으시오.

[root@ihd ~]# ps -l
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
4 S 0 3320 3318 0 80 0 - 27121 wait pts/0 00:00:00 bash
0 T 0 3486 3320 0 80 0 - 3200 signal pts/0 00:00:00 command
4 R 0 3499 3320 0 80 0 - 27036 - pts/0 00:00:00 ps
[root@ihd ~]# ( 괄호 ) -19 3486
3486: old priority 0, new priority –19
[root@ihd ~]# ps -l
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
4 S 0 3320 3318 0 80 0 - 27121 wait pts/0 00:00:00 bash
0 T 0 3486 3320 0 61 -19 - 3200 signal pts/0 00:00:00 command
4 R 0 3501 3320 0 80 0 - 27034 - pts/0 00:00:00 ps

<조  건>
- PID 3486 인 command 라는 프로세스의 우선순위를 변경한다.
- 기존 우선순위 0에서 -19로 우선순위를 조정한다.

 

프로세스의 우선순위 : 프로세스가 운영체제의 CPU를 선점할 수 있는 권한
nice 명령어 : 프로그램을 실행할 때 프로세스의 우선순위를 설정할 수 있는 명령어
renice 명령어 : 실행중인 프로그램의 우선순위를 조정할 수 있는 명령어

 

[root@server1 ~]# renice -help

Usage:
 renice [-n] <priority> [-p|--pid] <pid>...
 renice [-n] <priority>  -g|--pgrp <pgid>...
 renice [-n] <priority>  -u|--user <user>...

Options:
 -g, --pgrp <id>        interpret argument as process group ID
 -n, --priority <num>   specify the nice increment value
 -p, --pid <id>         interpret argument as process ID (default)
 -u, --user <name|id>   interpret argument as username or user ID
 -h, --help             display help text and exit
 -V, --version          display version information and exit

For more information see renice(1).

 

① renice

반응형