技术解析
我接了一个摄像头,设备描述符是 /dev/video0,用 sudo lsof /dev/video0 看不到任何信息,但是用 sudo lsof | grep /dev/video0 就能查到相关信息,有人知道是什么原理吗?
[email protected]:~$ sudo lsof /dev/video0
[email protected]:~$ sudo lsof | grep /dev/video0
python3 2040 root mem REG 0,79 245 /dev/video0 (path dev=0,6, inode=398)
python3 2040 root 21u CHR 81,0 0t0 245 /dev/video0
python3 2040 2186 root mem REG 0,79 245 /dev/video0 (path dev=0,6, inode=398)
python3 2040 2186 root 21u CHR 81,0 0t0 245 /dev/video0
python3 2040 2233 root mem REG 0,79 245 /dev/video0 (path dev=0,6, inode=398)
python3 2040 2233 root 21u CHR 81,0 0t0 245 /dev/video0
python3 2040 2234 root mem REG 0,79 245 /dev/video0 (path dev=0,6, inode=398)
python3 2040 2234 root 21u CHR 81,0 0t0 245 /dev/video0
python3 2040 2235 root mem REG 0,79 245 /dev/video0 (path dev=0,6, inode=398)
python3 2040 2235 root 21u CHR 81,0 0t0 245 /dev/video0
python3 2040 2236 root mem REG 0,79 245 /dev/video0 (path dev=0,6, inode=398)
python3 2040 2236 root 21u CHR 81,0 0t0 245 /dev/video0
python3 2040 2237 root mem REG 0,79 245 /dev/video0 (path dev=0,6, inode=398)
python3 2040 2237 root 21u CHR 81,0 0t0 245 /dev/video0