Linux basic commands Practice 1

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 pwd internal command ) 

[root@localhost ~]# type ls

ls is `ls --color = auto ' aliases

[root@localhost ~]# type du

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

[root@localhost ~]# type ifconfig

ifconfig /usr/sbin/ifconfig

2, please / create directory abc

[root@localhost ~]# mkdir /abc

[root@localhost ~]# ls /

abc  boot  etc   lib    media  opt   root  sbin  sys  usr  zhangjiaqi

bin  dev   home  lib64  mnt    proc  run   srv   tmp  var

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

[the 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 ~]# mkdir /abc/wbx{1..1000}

[root@localhost ~]# ls /abc

wbx1     wbx210  wbx323  wbx436  wbx549  wbx661  wbx774  wbx887

 

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

[the root @ localhost ~] #  CD / liangjian / liyunlong / weiheshang / duanpeng

[root@localhost duanpeng]# pwd

/ Liangjian / liyunlong / weiheshang / duanpeng

[root@localhost duanpeng]# cd ../..

[root@localhost liyunlong]# pwd

/ Liangjian / 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 abc]# rm -fr wbx{1..1000}

[root@localhost abc]# ls

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

[root@localhost abc]# ls

stu10.txt  stu14.txt  stu18.txt  stu2.txt  stu6.txt

stu11.txt  stu15.txt  stu19.txt  stu3.txt  stu7.txt

stu12.txt  stu16.txt  stu1.txt   stu4.txt  stu8.txt

stu13.txt  stu17.txt  stu20.txt  stu5.txt  stu9.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 /boot/vmlinuz* /abc

[root@localhost ~]# du /abc/vmlinuz*

4912 /abc/vmlinuz-0-rescue-1e2f1204383043569e93e86f8a057c05

4912 /abc/vmlinuz-3.10.0-229.el7.x86_64

 

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

[root@localhost abc]# mv vmlinuz-3.10.0-229.el7.x86_64 kgc

[root@localhost abc]# ls

kgc        stu1.txt

stu10.txt  stu20.txt

stu11.txt  stu2.txt

stu12.txt  stu3.txt

stu13.txt  stu4.txt

stu14.txt  stu5.txt

stu15.txt  stu6.txt

stu16.txt  stu7.txt

stu17.txt  stu8.txt

stu18.txt  stu9.txt

stu19.txt  vmlinuz-0-rescue-1e2f1204383043569e93e86f8a057c05

[root@localhost abc]# mv vmlinuz-0-rescue-1e2f1204383043569e93e86f8a057c05 /tmp

[root@localhost abc]# cd /tmp

[root@localhost tmp]# ls

hsperfdata_root

ks-script-CjJCT0

ssh-pD99kNe6JPLg

ssh-qlCLprGGealU

systemd-private-GdXfi3

systemd-private-GkZogA

systemd-private-hWXjl5

systemd-private-OM6y7g

systemd-private-SUqpm1

systemd-private-u5vgpx

vmlinuz-0-rescue-1e2f1204383043569e93e86f8a057c05

vmware-root

yum.log

yum_save_tx.2019-07-19.18-59.JAsUk0.yumtx

yum_save_tx.2019-07-23.09-03._DdbNC.yumtx

yum_save_tx.2019-07-23.09-04.VG05Pp.yumtx

yum_save_tx.2019-07-23.10-11.IzyuW_.yumtx

yum_save_tx.2019-07-23.10-34.Q5BLrw.yumtx

 

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

[root@localhost tmp]# stat vmlinuz-0-rescue-1e2f1204383043569e93e86f8a057c05

  File: "vmlinuz-0-Rescue-1e2f1204383043569e93e86f8a057c05"

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

Equipment: fd00h / 64768d Inode : 3024921      hard link: 1

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

Last Visit: 2019-07-2319: 18: 12.094724252 +0800

Recent changes: 2019-07-2319: 18: 12.694760142 +0800

Recent changes: 2019-07-2319: 21: 15.191348992 +0800

Created: -

 

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

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

/tmp/vmlinuz-0-rescue-1e2f1204383043569e93e86f8a057c05

[root@localhost tmp]# du -hs /tmp/vmlinuz-0-rescue-1e2f1204383043569e93e86f8a057c05

4.8M /tmp/vmlinuz-0-rescue-1e2f1204383043569e93e86f8a057c05

 

Guess you like

Origin www.cnblogs.com/fengling1998/p/11234179.html