면접 문제

17254 단어

1. 루트 디렉터리에 있는 모든 숨겨진 디렉터리 찾기

[root@chengyinwu ~]# find / -type d -name ".*"

2. 루트 디렉토리에서 rpm로 끝나는 모든 파일 찾기

[root@yinwucheng ~]# find / -type f -name "*.rpm"

3. /data/bak 디렉터리에서 15일 전 파일 삭제 찾기(시스템 시간 시뮬레이션 관련 환경 자체 수정)

[root@yinwucheng ~]# find /data/bak -type f -mtime +15 |xargs rm rf

4. "mount /dev /cdrom /mnt/" 를 사용하여 CD를 마운트하고 /mnt/ Packages 디렉터리에 들어가서 키워드 "tree" 와 "vsftpd" 가 있는 패키지가 있는지 찾기

[root@yinwucheng ~]# mount /dev/cdrom /mnt/
[root@yinwucheng ~]# cd /mnt/Packages/
[root@yinwucheng /mnt/Packages]# rpm -qa |grep -E 'tree|vsftpd'
tree-1.6.0-10.el7.x86_64
vsftpd-3.0.2-25.el7.x86_64

5. rpm 명령을 사용하여tree 소프트웨어를 설치합니다.

[root@yinwucheng /mnt/Packages]# rpm -ivh tree-1.6.0-10.el7.x86_64.rpm

6. 서버에 httpd라는 소프트웨어가 설치되어 있는지 확인하세요.

[root@yinwucheng /mnt/Packages]# rpm -q httpd

7. 문제를 이어서 없으면 rpm로 설치하세요.

[root@yinwucheng /mnt/Packages]# yum install httpd

8.httpd 서비스를 시작하고 10.0.0.0 이 인터페이스의 IP로 브라우저에 접근해서 결과가 있는지 확인하고 없으면 방화벽을 닫으십시오

[root@yinwucheng /mnt/Packages]# systemctl start httpd
[root@yinwucheng /mnt/Packages]# systemctl stop firewalld
[root@yinwucheng /mnt/Packages]# systemctl disable firewalld

9.httpd라는 패키지의 내용을 보십시오.

[root@yinwucheng /mnt/Packages]# rpm -ql httpd

10.httpd 이 소프트웨어의 프로필이 무엇인지 보기

[root@yinwucheng /mnt/Packages]# rpm -qc httpd
/etc/httpd/conf/httpd.conf

11.httpd라는 패키지의 상세한 정보를 보십시오.

[root@yinwucheng /mnt/Packages]# rpm -qi httpd

12.netstat 이 명령이 어떤 패키지에 속하는지 보기

[root@yinwucheng /mnt/Packages]# yum provides netstat
net-tools-2.0-0.24.20131004git.el7.x86_64

13. 서버에 sl 명령이 설치되어 있는지 확인하고 삭제를 요청하면 삭제에 설치합니다.

[root@yinwucheng /mnt/Packages]# rpm -qa sl
sl-5.02-1.el7.x86_64
[root@yinwucheng /mnt/Packages]# rpm -e sl

14. 온라인으로 몬godb라는 소프트웨어를 다운로드하는데 버전 번호는 3.0.0이다

[root@yinwucheng /mnt/Packages]# rpm -ivh https://mirrors.aliyun.com/mongodb/yum/redhat/7/mongodb-org/3.0/x86_64/RPMS/mongodb-org-mongos-3.0.0-1.el7.x86_64.rpm

15. 몬godb라는 소프트웨어 버전을 4.0.0으로 업그레이드

[root@yinwucheng /mnt/Packages]# rpm -Uvh https://mirrors.aliyun.com/mongodb/yum/redhat/7/mongodb-org/4.0/x86_64/RPMS/mongodb-org-mongos-4.0.0-1.el7.x86_64.rpm

16.rpm의 상용 매개 변수가 어떤 것들이 있는지 열거


옵션
묘사
-i
rpm 설치
-v
설치 세부 정보 표시
-h
rpm 설치 진행률 표시
옵션
묘사
rpm -q
지정된 패키지가 설치되어 있는지 확인
rpm -qa
시스템에 설치된 모든 RPM 패키지 목록 보기
rpm -qi
특정 소프트웨어 세부 정보 보기
rpm -ql
지정한 패키지에 설치된 디렉토리, 파일 목록 조회
rpm -qc
지정한 패키지의 구성 파일 조회
rpm -qf
파일 또는 디렉토리에 속하는 RPM 소프트웨어 쿼리

다음 몇 문제는yum 명령을 사용하세요


17.yum에서 rsync라는 소프트웨어를 설치합니다.

[root@chengyinwu ~]# yum install rsync -y

18. 여러 개의 소프트웨어를 설치한다. 예를 들어sl, lsof,net-tools, nmap 등이다.

[root@chengyinwu ~]# yum install sl lsof net-tools nmap -y

19.sl 삭제 명령

[root@chengyinwu ~]# yum remove sl -y

20. ping 명령이 패키지에 속하는지 확인

[root@chengyinwu ~]# yum provides ping
iputils-20160308-10.el7.x86_64

21. 서버에 사용할 수 있는yum 원본 창고가 있는지 확인하세요.

[root@chengyinwu ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id                                  repo name                                                              status
base/7/x86_64                            CentOS-7                                                               10,019
epel/x86_64                              Extra Packages for Enterprise Linux 7 - x86_64                         13,343
extras/7/x86_64                          CentOS-7                                                                  435
updates/7/x86_64                         CentOS-7                                                                2,500
repolist: 26,297

1. 시스템에 있는 베이스 원본을 아리운의 원본으로 업데이트
[root@yinwucheng ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

2. 시스템에 epel 원본을 추가하려면 아리운의 렌즈를 사용하십시오
[root@yinwucheng ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

3. 시스템에 자빅스 원본 창고 추가
 : zabbix 
[root@yinwucheng /etc/yum.repos.d]# vim zabbix.repo
[zabbix]
name=Zabbix Official Repository - \$basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/\$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591

[zabbix-non-supported]
name=Zabbix Official Repository non-supported - \$basearch
baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/\$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1
-----------------------------------------------------------------------------------------
 : 
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

4. 시스템의 베이스와 epel 원본을 청화원의 거울로 바꾸기
1.  /etc/yum.repos.d/CentOS-Base.repo
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$ba
search/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basear
ch&repo=extras
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus
/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basear
ch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

2.yum install epel-release

5. 명령 ntpdate 간단하게 다운로드
[root@yinwucheng ~]# yum install ntpdate -y

6. ntpdate 명령의 버전 업데이트
[root@yinwucheng ~]# yum   update ntpdate

7. 시스템에서 ntpdate 명령을 마운트 해제
[root@yinwucheng ~]# yum remove ntpdate -y

8. 시스템에서 사용할 수 있는yum 원본 창고 보이기
[root@yinwucheng ~]# yum repolist

9.tre로 시작하는 시스템의 모든 패키지를 표시합니다.
[root@yinwucheng ~]# yum list |grep "^tre*"

10. 시스템에서 업데이트 가능한 패키지 표시
[root@yinwucheng ~]# yum check-update

11. 시스템에 설치된 패키지 표시
[root@yinwucheng ~]# yum list installed

12.net-tools라는 패키지의 상세한 정보 보기
[root@yinwucheng ~]# rpm -qi net-tools

13. scp 이 명령이 어느 패키지에서 유래했는지 확인하세요.
[root@yinwucheng ~]# yum provides scp
openssh-clients-7.4p1-16.el7.x86_64

14. 로컬 패키지 캐시 정리
[root@yinwucheng ~]# yum clean packages

15.nginx 이 패키지는 어떤 소프트웨어에 의존하는지 살펴보기
 :
[root@yinwucheng ~]# yum install nginx -y
Dependency Installed:
  dejavu-fonts-common.noarch 0:2.33-6.el7                      dejavu-sans-fonts.noarch 0:2.33-6.el7                 
  fontconfig.x86_64 0:2.13.0-4.3.el7                           fontpackages-filesystem.noarch 0:1.44-8.el7           
  gd.x86_64 0:2.0.35-26.el7                                    gperftools-libs.x86_64 0:2.6.1-1.el7                  
  libX11.x86_64 0:1.6.5-2.el7                                  libX11-common.noarch 0:1.6.5-2.el7                    
  libXau.x86_64 0:1.0.8-2.1.el7                                libXpm.x86_64 0:3.5.12-1.el7                          
  libxcb.x86_64 0:1.13-1.el7                                   nginx-all-modules.noarch 1:1.12.2-3.el7               
  nginx-filesystem.noarch 1:1.12.2-3.el7                       nginx-mod-http-geoip.x86_64 1:1.12.2-3.el7            
  nginx-mod-http-image-filter.x86_64 1:1.12.2-3.el7            nginx-mod-http-perl.x86_64 1:1.12.2-3.el7             
  nginx-mod-http-xslt-filter.x86_64 1:1.12.2-3.el7             nginx-mod-mail.x86_64 1:1.12.2-3.el7  
--------------------------------------------------------------------------------------------------------------
 :
[root@yinwucheng ~]# yum deplist nginx

16.yum의 역사 기록 보기
[root@yinwucheng ~]# yum history

17.yum의 패키지 그룹과 관련된 명령 매개 변수를 알아보기
yum groups list                
yum groups install +  -y     
yum remove +  -y             

18.yum 명령의 상용 매개 변수를 정리한다.
   yum install     
​   yum remove      
​   yum list        
​   yum provides    
​   yum repolist    yum 
​   yum update      ( )

​   yum history      yum 
​   yum clean all packages      
​   yum makecache               
​   yum reinstall               
​   -y                          yes

19. 베이스와 epel의 원본을 아리운의 거울 원본으로 바꾸세요.
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

20. 로컬yum 창고를 자체적으로 구축하여 조작 과정을 작성하고 rpm 패키지는 디스크 렌즈에 있는 rpm 패키지를 사용할 수 있다.
1. selinux
systemctl stop firewalld
setenforce 0
2. 
mount /dev/cdrom /mnt
3. 
cd /etc/yum.repos.d/
gzip *
4. 
vim /etc/yum.repos.d/centos.d
[centos]
name = centos
baseurl = file:///mnt
gpgcheck = 0
enabled = 1
5. 
yum clean all
6. 
yum list
rpm -qa
yum install vsftpd -y

1. 기본(문제당 2점)
1.1 절대 경로와 상대 경로의 차이를 논술한다
  • 절대 경로: 뿌리/시작 경로가 모두 절대 경로라고 할 수 있다.예:/a.txt
  • 상대 경로: 현재 경로를 기준으로 합니다(예:.a.txt

  • 1.2 소프트 연결과 하드 연결의 차이점 약술
  • 소프트 링크: 단축키에 해당하고 서로 다른 inode는 Block을 가리키며 원본 파일을 삭제하면 소프트 링크가 효력을 상실한다
  • 하드 링크: 백업에 해당하며, 같은inode는 같은block을 가리키며, 원본 파일을 삭제하는 것은 하드 링크에 영향을 미치지 않는다
  • 1.3 명령 실행 프로세스 요약
  • 명령이 절대 경로를 통해 실행되는지 먼저 확인
  • 두 번째 명령에 별칭 설정이 있는지 여부
  • 세 번째 보기 명령이 내장 명령인지 외장 명령인지
  • 네 번째 명령이 내장되어 있으면 직접 실행할 수 있고 외부 명령이 있으면 캐시hash
  • 가 있는지 확인합니다
  • 마지막으로 $PATH 변수를 통해 명령을 찾습니다. 찾으면 정상적으로 실행할 수 있고 없으면 commant not found
  • 를 잘못 보고할 수 있습니다.
    1.4 질의 파일을 작성합니다.txt abc로 끝나는 줄
    grep 'abc$' file.txt

    1.5 파일 찾기.log 파일에 키워드'helloworld'의 내용을 포함하고 상하 두 줄의 방향을 1.txt
    grep -C 2 'helloworld' file.log > 1.txt

    1.6 회사 연구개발부의 사용자인 David 및 Peter가 그룹 A에 속한다고 가정한다
    1.6.1 해당하는 사용자와 그룹을 구축하고 해당하는 대응 관계를 설정한다.
    groupadd A
    useradd David -g A
    useradd Peter -g A

    1.6.2 디렉터리 만들기 yfa, 이 디렉터리 안의 파일은 연구개발부 인원만 읽기, 증가, 삭제, 수정 및 집행할 수 있고 다른 사용자는 이 디렉터리에 대해 어떠한 조작도 할 수 없다.
    mkdir yf_a
    chown .A yf_a yf_a
    chmod 770 yf_a

    1.6.3 디렉토리 만들기 yfb. 이 목록에 있는 파일은 연구개발부의David만 모든 권한을 가지고 있고 연구개발부의 다른 사람은 보기 권한만 있고 다른 부서는 어떠한 조작도 할 수 없다.
    mkdir yf_b
    chown David.A yf_b
    chmod 720 yf_b

    1.7 한 사용자oldboy와 사용자 그룹oldboy가 있는데 코드 디렉터리에서 만든 모든 파일은oldboy 그룹에 자동으로 귀속된다
    groupadd oldboy
    useradd oldboy -g oldboy
    mkdir code
    chown .oldboy code
    chmod g+s code

    1.8 두 개의 사용자 그룹python과 Linux가 있고python 그룹은/hom/python/디렉터리에 있는 모든 내용을 읽을 수 있지만 Linux 그룹이 읽을 수 없습니다.Linux 그룹은 읽기/home/linux/디렉터리에 있는 모든 파일을 수정할 수 있지만,python 그룹은 읽을 수 없습니다.구성 명령을 제공합니다.
    groupadd python
    groupadd Linux
    
    mkdir /hom/python/
    chown .python /hom/python/
    chmod 770 /hom/python
    
    mkdir /home/linux/
    chown .Linux /home/linux/
    chmod 770 /home/linux/

    2.find 관련(문제당 3점)
    2.1/tmp 디렉토리에서 소유자가 루트가 아닌 파일 찾기
    find /tmp -type f ! -user root

    2.2 찾기/var 디렉터리의 하위 주인은old이고 그룹은boy인 파일
    find /var -type f -user old -g boy

    2.3 파일 찾기/var 디렉토리에서 7일 전에 수정된 루트 그룹 파일 찾기
    find /var -type f -mtime +7 -group root

    2.4/etc 디렉토리에서 1M 이상이고 일반 파일 유형인 모든 파일 찾기
    find /etc -type f -size +1M 

    2.5/etc/디렉토리에서 100k 이상, 1M 미만의 파일 찾기
    find /etc/ -type f -size +100k -size -1M

    2.6 파일 이름에 txt가 포함된 파일 찾기/디렉토리
    find / -type f -name "*txt"

    2.7 찾기/디렉터리 아랫사람은oldboy 또는 아랫사람은oldgirl 파일
    find / -type f -user oldboy -o -group oldgirl

    2.8/tmp 디렉토리에서 15일 전 파일 삭제
    find /tmp -type f -mtime +15 |xargs rm -rf

    2.9 뿌리 찾기 이름은 1.txt 또는 2.txt 파일
    find / -type f -name "1.txt" -o -name "2.txt"

    2.10/tmp 디렉토리에서 모든 파일 찾기 및 삭제
    find /tmp/* -type f |xargs rm -rf

    3. tar 관련 (문제당 3점)
    3.1 zip 패키지/etc 디렉토리를 사용합니다.
    zip -r etc.zip /etc 

    3.2 zip으로/opt 디렉터리를 포장하고 포장 과정을 표시하지 않기를 요구합니다.
    zip -q -r opt.zip /opt

    3.3 현재 디렉토리에/data/etc.zip 압축 풀기
    unzip /data/etc.zip

    3.4 알려진 파일oldboy.zip, 압축을 풀지 않은 상태에서 이 파일의 내용을 어떻게 보는지
    zcat oldboy.zip

    3.5장/data/old.tar.gz/opt 디렉터리로 압축 풀기
    tar xf /data/old.tar.gz -C /opt

    3.6 스트레스를 풀지 않는 경우/data/old를 보십시오.tar.gz 가방에 뭐가 들어있어요?
    tar tf /data/old.tar.gz

    3.7/etc/디렉터리를 포장합니다./etc/hosts라는 파일을 포장하지 마십시오.
    tar etc.tar.gz /etc --exclude=/etc/hosts

    3.8/etc/디렉터리를 포장합니다./etc/hosts와/etc/passwd 두 파일을 포장하지 마십시오.
    tar etc.tar.gz /etc --exclude=/etc/hosts --exclude=/etc/passwd

    3.9 패키지/etc/디렉터리, 명령은 ip 주소로 압축됩니다: 예: 10.0.0.200etc.tar.gz
    tar $(ifconfig eth0 |awk 'NR==2 {print $2}')_etc.tar.gz /etc

    3.10 포장/etc/목록, 요구사항.bz2 형식
    tar cjf etc.bz2 /etc 

    4. 소프트웨어 설치 관련 (문제당 3점)
    4.1 rpm 명령을 사용하여 tree 소프트웨어를 설치합니다.
    rpm -ivh tree + 

    4.2 서버에 httpd라는 소프트웨어가 설치되어 있는지 확인하세요.
    rpm -q httpd

    4.3 httpd 패키지의 내용을 살펴본다.
    rpm -ql httpd

    4.4 httpd 패키지의 상세 정보를 확인합니다.
    rpm -qi httpd

    4.5 넷stat 이 명령이 어떤 패키지에 속하는지 보기
    yum provides netstat

    4.6 sl 제거 명령
    rpm -e sl

    4.7 이미 알고 있는 서비스의 몬godb 버전은 3.0이고, 현재 몬godb라는 소프트웨어 버전을 4.0으로 업그레이드하였습니다.rpm 업그레이드 명령을 주십시오
    rpm -Uvh + 

    4.8yum에서 rsync라는 소프트웨어를 설치한다.
    yum install rsync -y

    4.9yum은 여러 개의 소프트웨어를 설치한다. 예를 들어sl,lsof,net-tools,nmap 등이다.
    yum install sl lsof net-tools nmap -y

    4.10 서버에 사용할 수 있는 yum 소스 창고를 확인하세요.
    yum repolist

    5、진급(문제당 4점)
    5.1 "I am student"를/root/bgx1로 리디렉션txt
    echo "I am student" > /root/bgx1.txt

    5.2 원본 컴파일링의 절차 약술
    1. 
    2. 
    3. ./configure 
    4. 
    5. 
    6. 
    7. 
    8. 

    5.3/etc/디렉토리를 찾습니다.conf 끝, 수정 시간이 최근 7일인 파일, 압축/tmp/conf.tar.gz
    tar zcvf /tmp/conf.tar.gz  $(find  /etc/ -type f -mtime -7 -name "*.conf")

    5.4 찾기/디렉토리에서 a로 시작하는 디렉토리, zip으로 압축된 압축 패키지
    find / -type d -name "a*" -exec zip {} a.zip \;

    5.5 찾기/디렉터리에서oldboy에 속하는 파일을/home/oldboy/디렉터리로 복사
    find / -type f -user oldboy -exec cp {} /home/oldboy/

    6. 번역(문제당 2점)
    6.1 [root@test-200 ~]# cd/rot
    -bash: cd:/rot: No such file or directory
    6.2 [root@test-200 ~]# mdkir a
    -bash: mdkir: command not found
    6.3 [root@test-200 ~]# mkdir a
    mkdir: cannot create directory ‘a’: File exists 6.4
    [root@test-200 ~]# rm a
    rm: cannot remove ‘a’: Is a directory
    6.5 [root@test-200 ~]#rm a.txt
    rm:remove regular empty file ‘a.txt’?
    6.6 [root@test-200 ~]# cp/tmp/a.txt/root/a.txt
    cp:overwrite ‘/root/a.txt’?
    6.7 [root@test-200 ~]# id www
    id: www: no such user
    6.8[test@test-200/]$ cd/root
    bash: cd:/root: Permission denied
    6.9 [root@test-200/tmp]# cp -q a.txt c.txt
    cp: invalidoption -- 'q'
    6.10 [root@test-200/home]# useradd test
    useradd: user'test' already exists
    전재 대상:https://www.cnblogs.com/yinwu/p/11369432.html

    좋은 웹페이지 즐겨찾기