终端下打开文件,仿MAC下start命令
Tofloor
poster avatar
karmapa
deepin
2018-04-18 19:45
Author
  1. #!/bin/sh

  2. dde-file-manager -n $1 >/dev/null 2>&1 &

  3. if [ -f "$1" ]; then
  4.   PID=$!
  5.   sleep 2
  6.   kill $PID
  7. fi
Copy the Code

保存到 /usr/bin/start, 之后在终端环境下就能方便打开文件 / 打开目录。
eg,

start .  打开当前目录
start test.jpg  打开图片
Reply Favorite View the author
All Replies
avatar
woodelf
deepin
2018-04-18 20:23
#1
xdg-open了解一下?
Reply View the author
avatar
karmapa
deepin
2018-04-18 21:13
#2
https://bbs.deepin.org/post/155515
xdg-open了解一下?

学习,没找到这条命令  -_-
Reply View the author
avatar
要讲武德
deepin
2018-04-18 22:54
#3
这个功能非常实用, 上次我提了建议老王已经做了 , 但是好像一直没推送?


Reply View the author