"리눅스 중요 명령어 복구"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-==참고 자료== +==참고==))
잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>))
16번째 줄: 16번째 줄:
[root@zetawiki ~]# ls
[root@zetawiki ~]# ls
-bash: /usr/bin/ls: No such file or directory
-bash: /usr/bin/ls: No such file or directory
</source>
</syntaxhighlight>
;패키지 찾기
;패키지 찾기
<source lang='console'>
<source lang='console'>
[root@zetawiki ~]# rpm -qf /usr/bin/ls
[root@zetawiki ~]# rpm -qf /usr/bin/ls
coreutils-8.22-11.el7.x86_64
coreutils-8.22-11.el7.x86_64
</source>
</syntaxhighlight>
;재설치하기
;재설치하기
<source lang='console'>
<source lang='console'>
39번째 줄: 39번째 줄:
Installed size: 14 M
Installed size: 14 M
Is this ok [y/d/N]: y
Is this ok [y/d/N]: y
</source>
</syntaxhighlight>
<source lang='console'>
<source lang='console'>
... (생략)
... (생략)
46번째 줄: 46번째 줄:


Complete!
Complete!
</source>
</syntaxhighlight>
<source lang='console'>
<source lang='console'>
[root@zetawiki ~]# ls
[root@zetawiki ~]# ls
anaconda-ks.cfg
anaconda-ks.cfg
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==

2020년 11월 2일 (월) 00:43 판

1 개요

리눅스 중요 명령어 파일 복구
리눅스 명령어 파일 복원

2 실습

※ 주의!!! 진짜 망가질 수 있음

망가뜨리기

<source lang='console'> [root@zetawiki ~]# ls anaconda-ks.cfg [root@zetawiki ~]# which ls alias ls='ls --color=auto' /usr/bin/ls [root@zetawiki ~]# mv /usr/bin/ls /usr/bin/ls2 [root@zetawiki ~]# ls -bash: /usr/bin/ls: No such file or directory </syntaxhighlight>

패키지 찾기

<source lang='console'> [root@zetawiki ~]# rpm -qf /usr/bin/ls coreutils-8.22-11.el7.x86_64 </syntaxhighlight>

재설치하기

<source lang='console'> [root@zetawiki ~]# yum reinstall coreutils ... (생략)

2.1 ===============================================================================
Package               Arch               Version                   Repository        Size
2.2 ===============================================================================

Reinstalling:

coreutils             x86_64             8.22-11.el7               base             3.2 M

Transaction Summary

2.3 ===============================================================================

Reinstall 1 Package

Total download size: 3.2 M Installed size: 14 M Is this ok [y/d/N]: y </syntaxhighlight> <source lang='console'> ... (생략) Installed:

 coreutils.x86_64 0:8.22-11.el7                                                           

Complete! </syntaxhighlight> <source lang='console'> [root@zetawiki ~]# ls anaconda-ks.cfg </syntaxhighlight>

3 같이 보기

4 참고