Linux Learning Unit 14

Source: Internet
Author: User


Access to devices in 14.linux


# # # #1. Device Access # # #

1. Equipment identification

/DEV/XDXN # #硬盘设备/DEV/SDA1

/dev/cdrom # #光驱

/dev/mapper/* # #虚拟设备

2. Use of the device

# # "Discovery of Equipment" # #

fdisk-l # #查看真实存在的设备

cat/proc/partitions # #系统能够识别的设备

Blkid # #系统能够挂载使用的设备id

DF # #查看设备被系统使用的情况

650) this.width=650; "src=" https://s1.51cto.com/wyfs02/M00/91/47/wKioL1j04v7yV-UbAAC9wyYrYiM681.jpg "style=" float : none; "title=" 36020170417234420446.jpg "alt=" Wkiol1j04v7yv-ubaac9wyyryim681.jpg "/>


650) this.width=650; "src=" https://s1.51cto.com/wyfs02/M01/91/49/wKiom1j04v-CV1o4AADUo2mMs48241.jpg "style=" float : none; "title=" 36020170417234437315.jpg "alt=" Wkiom1j04v-cv1o4aaduo2mms48241.jpg "/>


# # "Use of equipment" # #

1. Mounting of the device

Mount Equipment mount point

Mount /DEV/SDB1 /mnt #把系统中第二块硬盘的第一个分区挂载到 the/mnt directory

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/91/49/wKiom1j042PggawIAAAdvZdDqK0735.jpg "title=" 36020170417234612755.jpg "alt=" Wkiom1j042pggawiaaadvzddqk0735.jpg "/>

2. Uninstalling the device

Umout Device | mount point

If the following conditions occur:

[Email protected] ~]# UMOUNT/DEV/SDB1

Umount:/home/kiosk/desktop/photo:target is busy.

(In some cases useful info about processes

The device is found by lsof (8) or fuser (1))

Solve:

FUSER-KVM Device | mount point - K Kill,-V show details,-m scan device

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/91/47/wKioL1j043Og-3c4AAAkVNOexC0693.jpg "title=" 36020170417234621789.jpg "alt=" Wkiol1j043og-3c4aaakvnoexc0693.jpg "/>

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/91/47/wKioL1j047ywr50jAACVYhgnL4M894.jpg "title=" 36020170417234734406.jpg "alt=" Wkiol1j047ywr50jaacvyhgnl4m894.jpg "/>

# # # #2. Soft and Hard Links # # #

Ls-i # #查看文件节点号

ln-s/file/file1 # #软链接

Ln/file/file1 # #硬链接

650) this.width=650; "src=" https://s1.51cto.com/wyfs02/M00/91/47/wKioL1j04_vQZzLUAACS8wMqDjk984.jpg "style=" float : none; "title=" 36020170417234850188.jpg "alt=" Wkiol1j04_vqzzluaacs8wmqdjk984.jpg "/>

650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M01/91/49/wKiom1j04_zh-nYuAACDDwO12Ng796.jpg "style=" float : none; "title=" 36020170417234858359.jpg "alt=" Wkiom1j04_zh-nyuaacddwo12ng796.jpg "/>


# # # #3. File Search # # #

1.locate filename # #在文件数据库中搜索filename信息, updatedb update file database

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/91/47/wKioL1j05C6hTI0yAACkbFUQ52c105.jpg "title=" 36020170417234951054.jpg "alt=" Wkiol1j05c6hti0yaackbfuq52c105.jpg "/>

2.find

Find Find Location -Conditions Condition Value -exec Action {} \;

-name

-not conditions

-user

-group

-size

-perm

--maxdepth

--mindepth

-A

-O

-type F file

Catalog D

C character Device

b block Devices

s Set of section words

L Links


Find/mnt-user Student

Find/mnt-group Linux

Find/mnt-user student-a-group Linux

Find/mnt-user Student-o-group Linux

Find/mnt-user student-a-group Linux

Find/mnt-user Student

Find/mnt-user student-a-not-group Linux

DD If=/dev/zero of=/mnt/file1 bs=1024 count=10

DD If=/dev/zero of=/mnt/file2 bs=1024 count=20

DD If=/dev/zero of=/mnt/file3 bs=1024 count=30

Find/mnt-size 10k

find/mnt-size-10k

Find/mnt-size +10k



4. How to find files in the system

# # # #find ########

Find command

Find path Condition Condition value

Find/mnt-name file

Find/mnt-name "file*"

Find/etc-name "*.conf"

-user # #用户

-group # #组

condition 1-o condition 2# #或者

-type # #类型

-mmin +|-Digital # #时间

DD If=/dev/zero of=/mnt/file bs=1024 count=10

DD # #数据截取

if # #数据模板

of # #数据存放文件

BS # #数据快大小

Count # #数据快个数

--size Digital |-Digital |+ Digital # # #查找大小符合条件的文件


--perm 444 # # #文件全权必须时rrr

--perm -444 # # #文件每一位都要含有r权限

--perm /444 # # #文件任意一位含有r权限

-maxdepth Digital # # #最深目录层

-mindepth Digital # # #最小目录层

-exec command {} \; # # #对查找出的结果做相应处理



650) this.width=650; "src=" https://s1.51cto.com/wyfs02/M01/91/47/wKioL1j05H_A8v2mAACrS2TvxGA163.jpg "style=" float : none; "title=" 36020170417235032678.jpg "alt=" Wkiol1j05h_a8v2maacrs2tvxga163.jpg "/>


650) this.width=650; "src=" https://s1.51cto.com/wyfs02/M02/91/49/wKiom1j05IGw_XhKAACfbiCfHmU327.jpg "style=" float : none; "title=" 36020170417235058597.jpg "alt=" Wkiom1j05igw_xhkaacfbicfhmu327.jpg "/>


650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M02/91/47/wKioL1j05NrQcAAbAAC-DnGYmWA491.jpg "style=" float : none; "title=" 36020170417235159694.jpg "alt=" Wkiol1j05nrqcaabaac-dngymwa491.jpg "/>

650) this.width=650; "src=" https://s1.51cto.com/wyfs02/M01/91/47/wKioL1j05Nvx58yFAACQeTpG4iw429.jpg "style=" float : none; "title=" 36020170417235223672.jpg "alt=" Wkiol1j05nvx58yfaacqetpg4iw429.jpg "/>

650) this.width=650; "src=" https://s1.51cto.com/wyfs02/M00/91/48/wKioL1j05emiUr7zAADGI5YK5Vw965.jpg "style=" float : none; "title=" 36020170417235401075.jpg "alt=" Wkiol1j05emiur7zaadgi5yk5vw965.jpg "/>

650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M01/91/49/wKiom1j05enASAZEAACK4_zgass596.jpg "style=" float : none; "title=" 36020170417235412490.jpg "alt=" Wkiom1j05enasazeaack4_zgass596.jpg "/>

650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M00/91/48/wKioL1j05erwFZWYAAC4vaulMlA454.jpg "style=" float : none; "title=" 36020170417235434560.jpg "alt=" Wkiol1j05erwfzwyaac4vaulmla454.jpg "/>

650) this.width=650; "src=" https://s3.51cto.com/wyfs02/M01/91/48/wKioL1j05ergD_coAADDCI4N0Zg687.jpg "style=" float : none; "title=" 36020170417235441418.jpg "alt=" Wkiol1j05ergd_coaaddci4n0zg687.jpg "/>

650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M02/91/49/wKiom1j05evCCf2wAAC8k2g8d7w884.jpg "style=" float : none; "title=" 36020170417235524456.jpg "alt=" Wkiom1j05evccf2waac8k2g8d7w884.jpg "/>

650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M01/91/49/wKiom1j05euwJLiZAADS8fv8H2k491.jpg "style=" float : none; "title=" 36020170417235540251.jpg "alt=" Wkiom1j05euwjlizaads8fv8h2k491.jpg "/>

650) this.width=650; "src=" https://s1.51cto.com/wyfs02/M02/91/48/wKioL1j05ezBe2PqAAAenATKY4A444.jpg "style=" float : none; "title=" 36020170417235611386.jpg "alt=" Wkiol1j05ezbe2pqaaaenatky4a444.jpg "/>



Linux Learning Unit 14

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.