linux machine for the first time on the job

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

[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 embedded ( This shows that the pwd command is an internal command)

[root@localhost /]# type ls

ls is `ls --color = auto ' alias ( Thus the ls command is an external command)

[root@localhost /]# type ifconfig

ifconfig is / usr / sbin / ifconfig ( Thus the ifconfig command is an external command)

[root@localhost /]# type du

du is / usr / bin / du ( seen du command is an external command)

3, create a directory in abc / under

   Please create the directory / liangjian / liyunlong / weiheshang / duanpeng under /

   Please create a directory under 1000 / abc, develop their own name.

[root@localhost /]# mkdir abc

[root @ localhost /] # mkdir -p / liangjian / liyunlong / weiheshang / duanpeng

[root@localhost /]# mkdir -p /abc/aa{1..1000}

4, switch to the next / liangjian / liyunlong / weiheshang / duanpeng manner by an absolute path

And to view the current path with the pwd, switch to / liangjian / liyunlong with the parent directory name, ".." under way

[root @ localhost /] # cd / liangjian / liyunlong / weiheshang / duanpeng

[root@localhost duanpeng]# pwd

/ Liangjian / liyunlong / weiheshang / duanpeng

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

[root@localhost liyunlong]#

5, delete the next / abc time you create a catalog of 1000, in the / abc at the beginning to re-create 20 stu ordinary readable document with the touch, the document as a .txt extension

[root@localhost liyunlong]# rm -rf /abc/aa*

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

6, the lower your / boot / directory at the beginning of the file with the cp command to copy vmlinuz under / abc, and to see the size of the disk space they occupy.

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

[root@localhost /]# du -a /abc/vmlinuz*

5740         /abc/vmlinuz-0-rescue-d80a17ab9909480a95e84c772cd3816c

5740         /abc/vmlinuz-3.10.0-693.el7.x86_64

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

[root@localhost /]# mv /abc/vmlinuz-0-rescue-d80a17ab9909480a95e84c772cd3816c /abc/kgc

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

 

8. Check / vmlinuz to detail beginning of the file under the tmp / directory status information.

[root@localhost /]# stat /tmp/vmlinuz-3.10.0-693.el7.x86_64

  File: "/ tmp / vmlinuz-3.10.0-693.el7.x86_64"

  Size: 5877760: 11480 IO block: 4096 regular file

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

Permissions: (0755 / -rwxr-xr-x) Uid :( 0 / root) Gid :( 0 / root)

Last Visit: 2019-07-2317: 22: 31.352435913 +0800

Recent changes: 2019-07-2317: 27: 02.701843250 +0800

Recent changes: 2019-07-2317: 28: 09.402714318 +0800

Created: -

9, use the find command to find / vmlinuz file size exceeds 1M and the beginning of next tmp directory

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

/tmp/vmlinuz-3.10.0-693.el7.x86_64

Guess you like

Origin www.cnblogs.com/zhiyuan-yu/p/11233998.html