我正在使用 ubuntu 12.04 lts,我想使用终端删除以下文件:
/etc/apt/sources.list.d/google-earth.list.save /home/jatin/google-earth-stable_current_i386.deb /home/jatin/google-earth-stable_current_i386.deb.1 /home/jatin/.cache/software-center/piston-helper/rec.ubuntu.com,api,1.0,recommend_app,google-earth-stable,,13c5f00780e1a1b88538de42b80aaada /home/jatin/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,any,any,any,google-earth-stable,page,1,helpful,,ea694de2da0c9426e7b795c702d8b1d2 /home/jatin/桌面/Debians/google-earth-stable_current_amd64.deb /home/jatin/下载/google-earth-stable_current_amd64.deb /usr/share/icons/oxygen/128x128/mimetypes/application-vnd-google-earth-kml.png /usr/share/icons/oxygen/16x16/mimetypes/application-vnd-google-earth-kml.png /usr/share/icons/oxygen/22x22/mimetypes/application-vnd-google-earth-kml.png /usr/share/icons/oxygen/32x32/mimetypes/application-vnd-google-earth-kml.png /usr/share/icons/oxygen/48x48/mimetypes/application-vnd-google-earth-kml.png /usr/share/icons/oxygen/64x64/mimetypes/application-vnd-google-earth-kml.png /usr/share/mime/application/vnd.google-earth.kml+xml.xml /usr/share/mime/application/vnd.google-earth.kmz.xml /var/cache/apt/archives/google-earth-stable_6.0.3.2197-r0_amd64.deb
并且它们分散在计算机中。有没有命令可以一次性将它们全部删除?
答案1
为什么不使用 rm ?
sudo rm path/to/file1 path/to/file2
答案2
如果您以某种方式找到了粘贴在问题上的文件列表,则可以使用rm
以下命令一次性删除所有文件:
将文件列表复制到gedit
(使用Ctrl+粘贴v),然后用空格( )替换( Ctrl+ h)换行符(),然后复制文本并键入并粘贴复制的文本。\n
' '
rm
答案3
从我在您的文件列表中看到的情况来看,您似乎是直接从 deb 包 (/home/jatin/google-earth-stable_current_i386.deb) 安装了 google-earth-stable。
如果你想要从计算机中删除该包,请输入sudo dpkg -r google-earth-stable
答案4
看起来您是从某处复制并粘贴该文件列表的。如果它是您在终端中运行的命令的输出,您可以将此输出通过管道传输到xargs rm
。
但在你这样做之前,我看到/usr/share/
列表中的文件,这表明它们显然是由包安装的google-earth-stable
。首先卸载它:
sudo apt-get remove --purge google-earth-stable
完成后,再次运行(搜索?)命令并将其传输到xargs rm
如下路径:
your_search_cmd | xargs rm