linux下常常使用rm,导致误操作删除一些重要的文档,很难恢复(当然也能恢复,不过比较复杂),所以在这种情况下,我们如果能给linux添加一个回收站就好多了,说白了,这个回收站机制也比较简单,就是使用 mv封装一个rm,简单的可以自己写个脚本,复杂点的就是在bin下添加这个封装命令就行了。
给linux添加一个回收站。
mkdir /tmp/trash_tmp 建立一个回收站目录
vi /bin/trash 编辑一个文件
mv $@ /tmp/trash_tmp
:wq 保存退出
alias rm=/bin/trash添加别名
vi /etc/bashrc
在最后一行添加alias rm=/bin/trash
chmod 755 /bin/trash
chmod 777 /tmp/trash_tmp
source /etc/bashrc 启用环境变量
如果要真的删除某个文件的时候用 /bin/rm -i file_name
这样一来一个回收站就建立了,以后用rm的时候会自动的将file_name 移动到/tmp/trash_tmp/目录下
给linux添加回收站
-
intellij idea远程开发的几个想法
我之前是用idea上面自带的stfp来做的本地开发同步到linux服务器编译,但是我发现这个如果多个客户端同时开发,或者多个同事一起开发,服务器上的就不能更新到本地。是不能增量更新到本地,必须全部下载,比对下载也行,但是工程量打了就特别慢。
-
mount_osxfuse: the OSXFUSE file system is not available (255) fuse: failed to mount file system: Undefined
mount_osxfuse: the OSXFUSE file system is not available (255) fuse: failed to mount file system: Undefined
-
mount_osxfuse: the OSXFUSE file system is not available (255) fuse: failed to mount file system: Undefined
mount_osxfuse: the OSXFUSE file system is not available (255) fuse: failed to mount file system: Undefined
-
System Extension Blocked - warning
After upgrading your macOS computer to High Sierra 10.13.4 or higher (starting in April 2018), you may see a message about a System Extension Blocked. At Williams we have seen this warning appear for these programs:
-
wsl Ubuntu ssh连接被拒绝,连接不上
如果密码正常,一切正常的清空下连接不上,你可以试试重启ssh sudo /etc/init.d/ssh restart
-
win10上使用win-sshfs
首先在GitHub上下载DokanSetup-1.0.5.1000和WinSSHFS-1.6.1.13-devel 注意:Dokan不能使用最新的版本,得使用1.0.5版本。要不win-sshfs会报Dokan版本错误的问题。(win10版本)
-
Ubuntu安装Node.js和npm
Node.js是基于Chrome的JavaScript构建的跨平台JavaScript运行时环境,npm是Node.js的默认程序包管理器,也是世界上最大的软件注册表。本篇文章展示了三种在Ubuntu 20.04服务器上安装Node.js和npm的方法。
-
ubuntu 上 Node.js 安装和卸载
ubuntu 上 Node.js 安装和卸载
-
解决 Module build failed: Error: ENOENT: no such file or directory错误
解决 Module build failed: Error: ENOENT: no such file or directory错误
-
nvm卸载、安装node和npm
1、node.js、nvm、 npm (1)在cmd中输入`where node`找到node长须所在位置进行删除 (2)确保计算机-环境变量删除相关引用 (3)在cmd中输入`node -v` ,得到以下结果,删除成功