1、请用命令查出ifconfig命令程序的绝对路径
[root@localhost ~]# which ifconfig
/usr/sbin/ifconfig
2、请用命令展示以下命令哪些是内部命令,哪些是外部命令?(cd \ pwd \ ls \ ifconfig \ du)
[root@localhost ~]# type cd
cd 是 shell 内嵌 (由此可见该命令cd为内部命令)
[root@localhost ~]# type pwd
pwd 是 shell 内嵌
[root@localhost ~]# type ls
ls 是 `ls --color=auto' 的别名
[root@localhost ~]# type ifconfig
ifconfig 是 /usr/sbin/ifconfig
[root@localhost ~]# type du
du 是 /usr/bin/du
3、请在/下创建目录abc
请在/下创建目录/liangjian/liyunlong/weiheshang/duanpeng
请在/abc下一次创建1000个目录,名字自己拟定。
[root@localhost ~]# mkdir /abc
[root@localhost ~]# mkdir -pv /liangjian/liyunlong/weiheshang/duanpeng
mkdir: 已创建目录 "/liangjian"
mkdir: 已创建目录 "/liangjian/liyunlong"
mkdir: 已创建目录 "/liangjian/liyunlong/weiheshang"
mkdir: 已创建目录 "/liangjian/liyunlong/weiheshang/duanpeng"
[root@localhost ~]# mkdir /abc/yi{1..1000}
[root@localhost ~]# ls /abc
yi1 yi180 yi262 yi344 yi426 yi508 yi590 yi672 yi754 yi836 yi918
yi10 yi181 yi263 yi345 yi427 yi509 yi591 yi673 yi755 yi837 yi919
yi100 yi182 yi264 yi346 yi428 yi51 yi592 yi674 yi756 yi838 yi92
yi1000 yi183 yi265 yi347 yi429 yi510 yi593 yi675 yi757 yi839 yi920
yi101 yi184 yi266 yi348 yi43 yi511 yi594 yi676 yi758 yi84 yi921
yi102 yi185 yi267 yi349 yi430 yi512 yi595 yi677 yi759 yi840 yi922
yi103 yi186 yi268 yi35 yi431 yi513 yi596 yi678 yi76 yi841 yi923
yi104 yi187 yi269 yi350 yi432 yi514 yi597 yi679 yi760 yi842 yi924
yi105 yi188 yi27 yi351 yi433 yi515 yi598 yi68 yi761 yi843 yi925
yi106 yi189 yi270 yi352 yi434 yi516 yi599 yi680 yi762 yi844 yi926
yi107 yi19 yi271 yi353 yi435 yi517 yi6 yi681 yi763 yi845 yi927
yi108 yi190 yi272 yi354 yi436 yi518 yi60 yi682 yi764 yi846 yi928
yi109 yi191 yi273 yi355 yi437 yi519 yi600 yi683 yi765 yi847 yi929
yi11 yi192 yi274 yi356 yi438 yi52 yi601 yi684 yi766 yi848 yi93
yi110 yi193 yi275 yi357 yi439 yi520 yi602 yi685 yi767 yi849 yi930
yi111 yi194 yi276 yi358 yi44 yi521 yi603 yi686 yi768 yi85 yi931
yi112 yi195 yi277 yi359 yi440 yi522 yi604 yi687 yi769 yi850 yi932
yi113 yi196 yi278 yi36 yi441 yi523 yi605 yi688 yi77 yi851 yi933
yi114 yi197 yi279 yi360 yi442 yi524 yi606 yi689 yi770 yi852 yi934
yi115 yi198 yi28 yi361 yi443 yi525 yi607 yi69 yi771 yi853 yi935
yi116 yi199 yi280 yi362 yi444 yi526 yi608 yi690 yi772 yi854 yi936
yi117 yi2 yi281 yi363 yi445 yi527 yi609 yi691 yi773 yi855 yi937
yi118 yi20 yi282 yi364 yi446 yi528 yi61 yi692 yi774 yi856 yi938
yi119 yi200 yi283 yi365 yi447 yi529 yi610 yi693 yi775 yi857 yi939
yi12 yi201 yi284 yi366 yi448 yi53 yi611 yi694 yi776 yi858 yi94
yi120 yi202 yi285 yi367 yi449 yi530 yi612 yi695 yi777 yi859 yi940
yi121 yi203 yi286 yi368 yi45 yi531 yi613 yi696 yi778 yi86 yi941
yi122 yi204 yi287 yi369 yi450 yi532 yi614 yi697 yi779 yi860 yi942
yi123 yi205 yi288 yi37 yi451 yi533 yi615 yi698 yi78 yi861 yi943
yi124 yi206 yi289 yi370 yi452 yi534 yi616 yi699 yi780 yi862 yi944
yi125 yi207 yi29 yi371 yi453 yi535 yi617 yi7 yi781 yi863 yi945
yi126 yi208 yi290 yi372 yi454 yi536 yi618 yi70 yi782 yi864 yi946
yi127 yi209 yi291 yi373 yi455 yi537 yi619 yi700 yi783 yi865 yi947
yi128 yi21 yi292 yi374 yi456 yi538 yi62 yi701 yi784 yi866 yi948
yi129 yi210 yi293 yi375 yi457 yi539 yi620 yi702 yi785 yi867 yi949
yi13 yi211 yi294 yi376 yi458 yi54 yi621 yi703 yi786 yi868 yi95
yi130 yi212 yi295 yi377 yi459 yi540 yi622 yi704 yi787 yi869 yi950
yi131 yi213 yi296 yi378 yi46 yi541 yi623 yi705 yi788 yi87 yi951
yi132 yi214 yi297 yi379 yi460 yi542 yi624 yi706 yi789 yi870 yi952
yi133 yi215 yi298 yi38 yi461 yi543 yi625 yi707 yi79 yi871 yi953
yi134 yi216 yi299 yi380 yi462 yi544 yi626 yi708 yi790 yi872 yi954
yi135 yi217 yi3 yi381 yi463 yi545 yi627 yi709 yi791 yi873 yi955
yi136 yi218 yi30 yi382 yi464 yi546 yi628 yi71 yi792 yi874 yi956
yi137 yi219 yi300 yi383 yi465 yi547 yi629 yi710 yi793 yi875 yi957
yi138 yi22 yi301 yi384 yi466 yi548 yi63 yi711 yi794 yi876 yi958
yi139 yi220 yi302 yi385 yi467 yi549 yi630 yi712 yi795 yi877 yi959
yi14 yi221 yi303 yi386 yi468 yi55 yi631 yi713 yi796 yi878 yi96
yi140 yi222 yi304 yi387 yi469 yi550 yi632 yi714 yi797 yi879 yi960
yi141 yi223 yi305 yi388 yi47 yi551 yi633 yi715 yi798 yi88 yi961
yi142 yi224 yi306 yi389 yi470 yi552 yi634 yi716 yi799 yi880 yi962
yi143 yi225 yi307 yi39 yi471 yi553 yi635 yi717 yi8 yi881 yi963
yi144 yi226 yi308 yi390 yi472 yi554 yi636 yi718 yi80 yi882 yi964
yi145 yi227 yi309 yi391 yi473 yi555 yi637 yi719 yi800 yi883 yi965
yi146 yi228 yi31 yi392 yi474 yi556 yi638 yi72 yi801 yi884 yi966
yi147 yi229 yi310 yi393 yi475 yi557 yi639 yi720 yi802 yi885 yi967
yi148 yi23 yi311 yi394 yi476 yi558 yi64 yi721 yi803 yi886 yi968
yi149 yi230 yi312 yi395 yi477 yi559 yi640 yi722 yi804 yi887 yi969
yi15 yi231 yi313 yi396 yi478 yi56 yi641 yi723 yi805 yi888 yi97
yi150 yi232 yi314 yi397 yi479 yi560 yi642 yi724 yi806 yi889 yi970
yi151 yi233 yi315 yi398 yi48 yi561 yi643 yi725 yi807 yi89 yi971
yi152 yi234 yi316 yi399 yi480 yi562 yi644 yi726 yi808 yi890 yi972
yi153 yi235 yi317 yi4 yi481 yi563 yi645 yi727 yi809 yi891 yi973
yi154 yi236 yi318 yi40 yi482 yi564 yi646 yi728 yi81 yi892 yi974
yi155 yi237 yi319 yi400 yi483 yi565 yi647 yi729 yi810 yi893 yi975
yi156 yi238 yi32 yi401 yi484 yi566 yi648 yi73 yi811 yi894 yi976
yi157 yi239 yi320 yi402 yi485 yi567 yi649 yi730 yi812 yi895 yi977
yi158 yi24 yi321 yi403 yi486 yi568 yi65 yi731 yi813 yi896 yi978
yi159 yi240 yi322 yi404 yi487 yi569 yi650 yi732 yi814 yi897 yi979
yi16 yi241 yi323 yi405 yi488 yi57 yi651 yi733 yi815 yi898 yi98
yi160 yi242 yi324 yi406 yi489 yi570 yi652 yi734 yi816 yi899 yi980
yi161 yi243 yi325 yi407 yi49 yi571 yi653 yi735 yi817 yi9 yi981
yi162 yi244 yi326 yi408 yi490 yi572 yi654 yi736 yi818 yi90 yi982
yi163 yi245 yi327 yi409 yi491 yi573 yi655 yi737 yi819 yi900 yi983
yi164 yi246 yi328 yi41 yi492 yi574 yi656 yi738 yi82 yi901 yi984
yi165 yi247 yi329 yi410 yi493 yi575 yi657 yi739 yi820 yi902 yi985
yi166 yi248 yi33 yi411 yi494 yi576 yi658 yi74 yi821 yi903 yi986
yi167 yi249 yi330 yi412 yi495 yi577 yi659 yi740 yi822 yi904 yi987
yi168 yi25 yi331 yi413 yi496 yi578 yi66 yi741 yi823 yi905 yi988
yi169 yi250 yi332 yi414 yi497 yi579 yi660 yi742 yi824 yi906 yi989
yi17 yi251 yi333 yi415 yi498 yi58 yi661 yi743 yi825 yi907 yi99
yi170 yi252 yi334 yi416 yi499 yi580 yi662 yi744 yi826 yi908 yi990
yi171 yi253 yi335 yi417 yi5 yi581 yi663 yi745 yi827 yi909 yi991
yi172 yi254 yi336 yi418 yi50 yi582 yi664 yi746 yi828 yi91 yi992
yi173 yi255 yi337 yi419 yi500 yi583 yi665 yi747 yi829 yi910 yi993
yi174 yi256 yi338 yi42 yi501 yi584 yi666 yi748 yi83 yi911 yi994
yi175 yi257 yi339 yi420 yi502 yi585 yi667 yi749 yi830 yi912 yi995
yi176 yi258 yi34 yi421 yi503 yi586 yi668 yi75 yi831 yi913 yi996
yi177 yi259 yi340 yi422 yi504 yi587 yi669 yi750 yi832 yi914 yi997
yi178 yi26 yi341 yi423 yi505 yi588 yi67 yi751 yi833 yi915 yi998
yi179 yi260 yi342 yi424 yi506 yi589 yi670 yi752 yi834 yi916 yi999
yi18 yi261 yi343 yi425 yi507 yi59 yi671 yi753 yi835 yi917
4、请用绝对路径方式切换到/liangjian/liyunlong/weiheshang/duanpeng 目录下
并用pwd查看当前的路径,请用上级目录名".."方式切换到 /liangjian/liyunlong下
[root@localhost ~]# cd /liangjian/liyunlong/weiheshang/duanpeng
[root@localhost duanpeng]# pwd
/liangjian/liyunlong/weiheshang/duanpeng
[root@localhost duanpeng]# cd ..
[root@localhost weiheshang]# cd ..
[root@localhost liyunlong]#
5、请一次删除/abc下一次创建的1000个目录,请在/abc下用touch再创建20个以stu开头的普通可读文档,文档后缀为.txt
[root@localhost ~]# rm -fr /abc/yi{1..1000}
[root@localhost ~]# ls /abc
[root@localhost ~]#
[root@localhost ~]# cd /abc
[root@localhost abc]# touch stu{1..20}.txt
[root@localhost abc]# ls /abc
stu10.txt stu13.txt stu16.txt stu19.txt stu2.txt stu5.txt stu8.txt
stu11.txt stu14.txt stu17.txt stu1.txt stu3.txt stu6.txt stu9.txt
stu12.txt stu15.txt stu18.txt stu20.txt stu4.txt stu7.txt
[root@localhost abc]#
6、请用cp命令将/boot/目录下以vmlinuz开头的文件拷贝到/abc下,并以查看他们占磁盘的空间大小。
[root@localhost ~]# cp -rf /boot/vmlinuz* /abc
[root@localhost ~]# ls /abc
vmlinuz-0-rescue-dedc02ad033f4c8cbdb37a00d906b050
vmlinuz-3.10.0-229.el7.x86_64
root@localhost ~]# ls -lh /abc/vmlinuz*
-rwxr-xr-x. 1 root root 4.8M 7月 24 09:18 /abc/vmlinuz-0-rescue-dedc02ad033f4c8cbdb37a00d906b050
-rwxr-xr-x. 1 root root 4.8M 7月 24 09:18 /abc/vmlinuz-3.10.0-229.el7.x86_64
7、将其中一个vmlinuz开头的文件改名为kgc,另外一个剪切到/tmp目录下。
[root@localhost ~]# mv /abc/vmlinuz-3.10.0-229.el7.x86_64 /abc/kgc
[root@localhost ~]# ls /abc
kgc
[root@localhost ~]# mv /abc/vmlinuz-0-rescue-dedc02ad033f4c8cbdb37a00d906b050 //tmp
[root@localhost ~]# ls /tmp
vmlinuz-0-rescue-dedc02ad033f4c8cbdb37a00d906b050
8、查看/tmp/目录下以vmlinuz开头文件的详细状态信息。
[root@localhost ~]# stat /tmp/vmlinuz*
文件:"/tmp/vmlinuz-0-rescue-dedc02ad033f4c8cbdb37a00d906b050"
大小:5029136 块:9824 IO 块:4096 普通文件
设备:fd00h/64768d Inode:1890135 硬链接:1
权限:(0755/-rwxr-xr-x) Uid:( 0/ root) Gid:( 0/ root)
环境:unconfined_u:object_r:default_t:s0
最近访问:2019-07-24 09:21:29.220853721 +0800
最近更改:2019-07-24 09:18:48.148525010 +0800
最近改动:2019-07-24 09:26:44.634152893 +0800
创建时间:-
9、用find命令查找/tmp目录下以vmlinuz开头及大小超过1M的文件
[root@localhost ~]# find /tmp -name vmlinuz* -a -size +1M
/tmp/vmlinuz-0-rescue-dedc02ad033f4c8cbdb37a00d906b050
[root@localhost ~]# ls -lh /tmp/vmlinuz-0-rescue-dedc02ad033f4c8cbdb37a00d906b050-rwxr-xr-x. 1 root root 4.8M 7月 24 09:18 /tmp/vmlinuz-0-rescue-dedc02ad033f4c8cbdb37a00d906b050