我还是一个Linux新手,我想知道:什么是Linux目录//?
我可以使用cd /将dir(cd)更改为根目录
~> cd /
/>
Run Code Online (Sandbox Code Playgroud)
使用pwd(工作目录的打印名称)告诉我我在root(/)
/> pwd
/
Run Code Online (Sandbox Code Playgroud)
使用ls(列出目录内容)我看到以下内容(使用Raspbian Jessie)
/> ls
bin boot dev etc home include lib lost+found media mnt opt proc root run sbin share srv sys tmp usr var
Run Code Online (Sandbox Code Playgroud)
我错误地将dir更改为//并发现它是有效的:
~> cd //
//>
Run Code Online (Sandbox Code Playgroud)
另外使用pwd告诉我我在一个名为//的目录中:
//> pwd
//
Run Code Online (Sandbox Code Playgroud)
但是使用ls我看到我可能仍然处于'某种东西'看起来像根.
//> ls
bin boot dev etc home include lib lost+found media mnt opt proc root run sbin share srv sys tmp usr var
Run Code Online (Sandbox Code Playgroud)
...但告诉我它叫//(rootroot ;-)
那么目录是什么//?
我是在 Raspberry Pi 3 上运行的 node-red 的新手,在 Node-red 编辑器中、某些内置节点(例如 mqtt 节点)上搜索不同图标时没有找到解释。该节点上的红色和蓝色图标的含义和用途是什么?
在Python中有一种简单的方法来格式化时间(delta),如下所示:
10:11:12 -> 10:11:12
09:10:11 -> 9:10:11
00:10:11 -> 10:11
00:09:10 -> 9:10
00:00:10 -> 10 (or maybe as 0:10)
00:00:09 -> 9 (or maybe as 0:09)
Run Code Online (Sandbox Code Playgroud)
即抑制前导零和分隔符(但可能不是在时间增量<1分钟时)