Linux operating system administration for the first time

Work on the machine :

1 , please find out with the command ifconfig absolute path command program

[root@localhost ~]# which ifconfig

/usr/sbin/ifconfig

2 , please use the following command to display the command which is an internal command, which is an external command ? (Cd \ pwd \ ls \ ifconfig \ du)

[root@localhost ~]# type cd

cd is a shell built ( we can see the command cd internal command )

[root@localhost ~]# type pwd

pwd is a shell built  ( we can see the command cd internal command )

[root@localhost ~]# type ls

ls is `ls --color = auto ' aliases

[root@localhost ~]# type ifconfig

ifconfig /usr/sbin/ifconfig

[root@localhost ~]# type du

du has been hashed (/ usr / bin / du)

 

3, please in / create directory abc

[root@localhost ~]# mkdir /abc

 

Please / Create a directory / liangjian / liyunlong / weiheshang / duanpeng

[Root @ localhost ~] # mkdir -pv / liangjian / liyunlong / weiheshang / duanpeng

mkdir: we have created the directory "/ liangjian"

mkdir: it has created the directory "/ liangjian / liyunlong"

mkdir: you have created the directory "/ liangjian / liyunlong / weiheshang"

mkdir: you have created the directory "/ liangjian / liyunlong / weiheshang / duanpeng"

Please / abc first created under the 1000 directory, to develop their own name.

[root@localhost ~]# cd /abc

[root@localhost abc]# mkdir -pv a{1..1000}

mkdir: has been created directory "a1"

mkdir: has been created directory "a2"

mkdir: has been created directory "a3"

mkdir: has been created directory "a4"

mkdir: has been created directory "a5"

mkdir: has been created directory "a6"

 

4 , a switch to mode absolute path / liangjian / liyunlong / weiheshang / duanpeng directory

And with pwd view the current path, with the name of the parent directory ".." to switch to the mode / liangjian / liyunlong down

[root@localhost abc]# cd

[Root @ localhost ~] # cd / liangjian / liyunlong / weiheshang / duanpeng

[root@localhost duanpeng]# pwd

/ Liangjian / liyunlong / weiheshang / duanpeng

[Root @ localhost duanpeng] # cd / liangjian / liyunlong

[root@localhost liyunlong]#

5 , delete the first / abc next time you create a 1000 directory, in the / abc case with touch and then create 20 Ge to stu beginning of ordinary readable document, the document suffix .txt

[root@localhost liyunlong]# cd /abc

[root@localhost abc]# rm -rf a{1..1000}

[root@localhost abc]# touch stu{1..20}.txt

[root@localhost abc]# ls

stu10.txt  stu2.txt

stu11.txt  stu3.txt

stu12.txt  stu4.txt

stu13.txt  stu5.txt

stu14.txt  stu6.txt

stu15.txt  stu7.txt

stu16.txt  stu8.txt

stu17.txt  stu9.txt

stu18.txt  stu19.txt  

stu1.txt   stu20.txt

 

6 , please use the cp command / boot / directory to vmlinuz files are copied to the beginning / abc lower, and to see the size of the disk space they occupy.

[root@localhost ~]# cp -fr /boot/vmlinuz* /abc

[root@localhost ~]# cd /abc

[root@localhost abc]# ls

stu10.txt  stu2.txt

stu11.txt  stu3.txt

stu12.txt  stu4.txt

stu13.txt  stu5.txt

stu14.txt  stu6.txt

stu15.txt  stu7.txt

stu16.txt  stu8.txt

stu17.txt  stu9.txt

stu18.txt  vmlinuz

stu19.txt  vmlinuz-0-rescue-1781126a035244acbfb57d3f9b9955cf

stu1.txt   vmlinuz-3.10.0-229.el7.x86_64

stu20.txt

 

[root@localhost abc]# du -sh

9.6M.

7 , in which a vmlinuz beginning of the file is renamed KGC , a further cut to / tmp directory.

[root@localhost abc]# mv vmlinuz-0-rescue-1781126a035244acbfb57d3f9b9955cf kgc

[root@localhost abc]# ls

kgc        stu15.txt  stu20.txt  stu7.txt

stu10.txt  stu16.txt  stu2.txt   stu8.txt

stu11.txt  stu17.txt  stu3.txt   stu9.txt

stu12.txt  stu18.txt  stu4.txt   vmlinuz

stu13.txt  stu19.txt  stu5.txt   vmlinuz-3.10.0-229.el7.x86_64

stu14.txt  stu1.txt   stu6.txt

 

 

[root@localhost abc]# cd

[root@localhost ~]# mv /abc/vmlinuz-3.10.0-229.el7.x86_64  /tmp

[root@localhost ~]# cd /tmp

[root@localhost tmp]# ls                 

hsperfdata_root         systemd-private-PBSqBr

ks-script-4BkH3y        systemd-private-QWHDdE

ssh-6Mdsp0Wi2oLf        systemd-private-rVPz0P

ssh-IZ3FITvrrrrS        systemd-private-tpQOLh

ssh-jI1uHRAhmWSu        systemd-private-x0D2yP

ssh-SRTlh3lLi9Yq        systemd-private-Z2SRR1

systemd-private-6sN7gJ systemd-private-zqFTlU

systemd-private-8f5azw  vmlinuz-3.10.0-229.el7.x86_64

systemd-private-GpNskW  vmware-root

systemd-private-Ip1Y8f  yum.log

systemd-private-KaqASR  yum_save_tx.2019-07-23.19-03.Eoc23z.yumtx

 

8 , see the / tmp / to the directory vmlinuz detail beginning of the file status information.

[root@localhost tmp]# stat vmlinuz*

  File: "vmlinuz-3.10.0-229.el7.x86_64"

  Size: 5029136    block: 9824 IO block: 4096    regular file

Equipment: fd00h / 64768d Inode : 75,476,714     hard link: 1

Permissions: (0755 / XR--rwxr-X) Uid : (0 / the root) Gid : (0 / the root)

环境:unconfined_u:object_r:default_t:s0

Last Visit: 2019-07-2320: 59: 48.467156144 +0800

Recent changes: 2019-07-2320: 59: 48.480156188 +0800

Recent changes: 2019-07-2321: 08: 06.843825517 +0800

Created: -

[root@localhost tmp]#

 

9 , with find find command / tmp to directory vmlinuz beginning and larger than 1M file

 

[root@localhost tmp]# find -name "vmlinuz*" -a -size +1M

./vmlinuz-3.10.0-229.el7.x86_64

 

Guess you like

Origin www.cnblogs.com/ZCQ123456/p/11234598.html