3, File Management - face questions

Questions Content

3, File Management - face questions


Write your own answers (wrong question mark coarse and tilt)

1、

[root@centos7 b]# mv file1 ../../dic

2、

[root@centos7 b]# ln  -s /lib64/libc.so /usr/lib64/libc.so
or
[root@centos7 b]# ln ../../lib64/libc.so.6 /usr/lib64/libc.so.64 -s 
[root@centos7 b]# ll /usr/lib64/libc.so.64
lrwxrwxrwx. 1 root root 21 8月   7 07:08 /usr/lib64/libc.so.64 -> ../../lib64/libc.so.6

3、-p

4、ln -s

5、pwd

6、

[root@centos7 tmp]# mkdir dic

7, cp -a; the alias cp = 'cp -a' write vim /etc/profile.d/env.sh

8、/root

9、-

10, df -i inode node to view this partition is not full, if full, delete some useless files, or put another plate

11, / root partition and / boot partition. swap

12、mv

13、-d

14, su -

15、4

16, soft links and hard links

17, the file is occupied by the program

18, rc.local start loading files, perform some procedures inside; message is CentOS system log files

19、

**bash<br/>[root@docker1 ~]# sed 's/test/good/g' /home/test/ct -i<br/>

20、

[root@centos7 tmp]# ls -hl
总用量 1012M
drwxr-xr-x. 3 root root   15 8月   7 07:04 b
drwxr-xr-x. 2 root root    6 8月   7 07:10 dic
-rw-r--r--. 1 root root 5.0K 8月   7 07:34 test1
-rw-r--r--. 1 root root 500M 8月   7 07:35 test2

21、

[root@centos7 tmp]# df -h
文件系统        容量  已用  可用 已用% 挂载点
/dev/sda2       100G  5.7G   95G    6% /
devtmpfs        974M     0  974M    0% /dev
tmpfs           991M     0  991M    0% /dev/shm
tmpfs           991M   11M  980M    2% /run
tmpfs           991M     0  991M    0% /sys/fs/cgroup
/dev/sda1      1014M  166M  849M   17% /boot
/dev/sda3        50G  833M   50G    2% /data
tmpfs           199M   40K  199M    1% /run/user/0
/dev/sr0         11G   11G     0  100% /run/media/root/CentOS 7 x86_64

22、df -h

23、

In essence: soft link is a new file, hard links are different names of the source file

Source File: Source file is deleted after the soft link will not be available after a hard link deleted files are still available

Number of links: hard links will increase the number of links to a file, not a soft link

inode number of: hard link node number and source files, soft link node number and the same source file

Across partitions: hard links can not span partitions, soft link

Link file size: small soft link, as few bytes, hard links and source files

Relative path method: a hard link relative to the current path, the soft link: When using the write path to the source file path relative to the link file

*** 24, use the following command to trigger scans the hard disk, then lsblk you can see, you can operate


[root@centos7 ~]# echo '- - -' > /sys/class/scsihost/host2/scan 
[root@centos7 ~]# echo '- - -' > /sys/class/scsihost/host1/scan 
[root@centos7 ~]# echo '- - -' > /sys/class/scsihost/host0/scan
```*

25、c

26、a

27、a

28、d

***29、该文件可能被某程序占用,使用lsof | grep ‘文件名’看下哪个程序在使用,杀死或重启该程序***

---

### 参考答案:
![](https://s1.51cto.com/images/blog/201907/23/bc3c0397e053d84e49bd5e0bfa3fea52.png)
![](https://s1.51cto.com/images/blog/201907/23/4e9ad94a1aeecdb99046258f25077405.png)
![](https://s1.51cto.com/images/blog/201907/23/45447849a748c057c62e182398894c53.png)
![](https://s1.51cto.com/images/blog/201907/23/4eb247902f84483d05dd083d8cbccb19.png)

Guess you like

Origin blog.51cto.com/14012942/2422729