Linux Shell 判断块设备节点是否存在
/*************************************************************************
* Linux Shell 判断块设备节点是否存在
* 说明:
* 能牌问shell脚本-f不能判断mmc设备节点的问题,查了一下资料,发现不能
* 使用-f来判断,要使用-e或者-b来判断才行。
*
* 2017-1-17 深圳 南山平山村 曾剑锋
************************************************************************/ 一、参考文档:
. shell脚本判断设备节点是否存在
http://www.360doc.com/content/12/0304/10/1317564_191540155.shtml 二、参数说明:
-b file = True if the file exists and is block special file.块设备文件存在
-c file = True if the file exists and is character special file.字符设备文件存在
-d file = True if the file exists and is a directory.目录文件存在
-e file = True if the file exists.文件存在
-f file = True if the file exists and is a regular file普通文件存在
-g file = True if the file exists and the set-group-id bit is set.文件存在且设置了组标记位
-k file = True if the files' "sticky" bit is set.
-L file = True if the file exists and is a symbolic link.文件存在且是个符号文件
-p file = True if the file exists and is a named pipe.文件存在且是一个命名管道
-r file = True if the file exists and is readable.文件存在且是可读的
-s file = True if the file exists and its size is greater than zero.文件存在
Linux Shell 判断块设备节点是否存在的更多相关文章
- I.MX6 linux eGalaxTouch 自动获取设备节点
I.MX6 linux eGalaxTouch 自动获取设备节点 \\\\\\\\\\\\\\-*- 目录 -*-///////////// | 一. 需求: | 二. /proc/bus/input ...
- Linux显示列出块设备
Linux显示列出块设备 youhaidong@youhaidong-ThinkPad-Edge-E545:~$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOI ...
- linux系统下块设备驱动程序
顾名思义,块设备驱动程序就是支持以块的方式进行读写的设备.块设备和字符设备最大的区别在于读写数据的基本单元不同.块设备读写数据的基本单元为块,例 如磁盘通常为一个sector,而字符设备的基本单元为字 ...
- Linux加载DTS设备节点的过程(以高通8974平台为例)
DTS是Device Tree Source的缩写,用来描述设备的硬件细节.在过去的ARM Linux中,arch/arm/plat-xxx和arch/arm/mach-xxx中充斥着大量的垃圾代码, ...
- linux下的块设备驱动(一)
块设备的驱动比字符设备的难,这是因为块设备的驱动和内核的联系进一步增大,但是同时块设备的访问的几个基本结构和字符还是有相似之处的. 有一句话必须记住:对于存储设备(硬盘~~带有机械的操作)而言,调整读 ...
- 深入理解Linux内核-块设备驱动程序
扇区: 1.硬盘控制器将磁盘看成一大组扇区2.扇区就是一组相邻字节3.扇区按照惯例大小设置位512字节4.存放在块设备中的数据是通过它们在磁盘上的位置来标识,即首个扇区的下标和扇区的数目.5.扇区是硬 ...
- Linux shell 判断字符串为空等常用命令
1.判断字符串为空 if [ -z "$str" ]; then echo "empty string" fi 2.判断文件是否存在 if [ -f /home ...
- linux下的块设备驱动(二)
上一章主要讲了请求队列的一系列问题.下面主要说一下请求函数.首先来说一下硬盘类块设备的请求函数. 请求函数可以在没有完成请求队列的中的所有请求的情况下就返回,也可以在一个请求都不完成的情况下就返回. ...
- linux c 编程 ------ 通过设备节点调用驱动
驱动程序如下,加载驱动后,会在/dev文件夹下生成一个文件hello_device_node,是此驱动的设备节点 #include <linux/init.h> #include < ...
随机推荐
- Netty实战
一.Netty异步和事件驱动1.Java网络编程回顾socket.accept 阻塞socket.setsockopt /非阻塞2.NIO异步非阻塞a).nio 非阻塞的关键时使用选择器(java.n ...
- jquery基础研究学习【HTML】
jQuery HTMLjQuery 捕获jQuery 设置jQuery 添加元素jQuery 删除元素jQuery CSS 类jQuery css() 方法jQuery 尺寸 笔记:
- 【BZOJ3672】[Noi2014]购票 树分治+斜率优化
[BZOJ3672][Noi2014]购票 Description 今年夏天,NOI在SZ市迎来了她30周岁的生日.来自全国 n 个城市的OIer们都会从各地出发,到SZ市参加这次盛会. ...
- Stacks of Flapjacks(栈)
Stacks of Flapjacks Background Stacks and Queues are often considered the bread and butter of data ...
- Collect More Jewels(hdu1044)(BFS+DFS)
Collect More Jewels Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Othe ...
- java拾遗3----XML解析(三) StAX PULL解析
使用PULL方式解析XML: Pull是STAX的一个实现 StAX是The Streaming API for XML的缩写,一种利用拉模式解析(pull-parsing)XML文档的API StA ...
- Unable to determine IP address from host name
- DNN优势
- php建立一个空类: stdClass
$pick = new stdClass; $pick->type = 'full'; ;
- 默写一个socket客户端和socket服务端的基本通信,即:收发消息
Server: import socket sk = socket.socket() sk.bind(('192.168.0.95',8898)) #把地址绑定到套接字 sk.listen() #监听 ...