标签:files help locations 垃圾桶 alias ubuntu gio trash
一、引言
前几天发现rm删除文件后文件找不回来了,上网找办法发现都很麻烦。
于是我alias rm='rm -i'
这样每次删除都会询问我。但是我是个急性子根本不管直接y,遇到文件夹时都要崩溃了,所以在删文件夹时直接-rf。
又于是误删操作还是时有发生。
二、问题解决
ubuntu的桌面上有个垃圾桶图标
何不利用起来,于是发现了gio命令
Trash在~/.local/share/Trash
gio trash [files] 将文件移动到垃圾桶
恢复只能手动恢复,路径在~/.local/share/Trash/info中
Usage:
gio COMMAND [ARGS…]
Commands:
help Print help
version Print version
cat Concatenate files to standard output
copy Copy one or more files
info Show information about locations
list List the contents of locations
mime Get or set the handler for a mimetype
mkdir Create directories
monitor Monitor files and directories for changes
mount Mount or unmount the locations
move Move one or more files
open Open files with the default application
rename Rename a file
remove Delete one or more files
save Read from standard input and save
set Set a file attribute
trash Move files or directories to the trash
tree Lists the contents of locations in a tree
Use “gio help COMMAND” to get detailed help.
之后的事情简单起来了我兴冲冲的alias gio trash='gt'
bash: alias:
gio trash': invalid alias name
才发现trash时command字段,将就用吧
标签:files,help,locations,垃圾桶,alias,ubuntu,gio,trash 来源: https://www.cnblogs.com/liuhengzhi/p/14748512.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。