{"id":2110,"date":"2018-09-14T05:54:02","date_gmt":"2018-09-13T20:54:02","guid":{"rendered":"http:\/\/matoken.org\/blog\/?p=2110"},"modified":"2018-09-16T09:49:19","modified_gmt":"2018-09-16T00:49:19","slug":"the-trash-can-also-be-used-with-trash-cli-in-cli","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2018\/09\/14\/the-trash-can-also-be-used-with-trash-cli-in-cli\/","title":{"rendered":"trash-cli \u3067 cli \u3067\u3082\u30b4\u30df\u7bb1\u5229\u7528"},"content":{"rendered":"<div id=\"__asciidoctor-preview-1__\" class=\"paragraph\">\n<p>rm \u30b3\u30de\u30f3\u30c9\u306f\u3068\u3066\u3082\u5f37\u529b\u3067\u3059\uff0e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3082\u306a\u304f\u8aa4\u3063\u3066\u524a\u9664\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u5fa9\u65e7\u3067\u304d\u306a\u3044\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u3067\u3059\uff0e<br \/>\n\u305d\u3053\u3067 rm \u306e alias \u306b rm -i \u3092\u6307\u5b9a\u3057\u3066\u78ba\u8a8d\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u3059\u306a\u3069\u3057\u3066\u3044\u308b\u74b0\u5883\u3082\u3042\u308a\u307e\u3059\u304c\uff0c\u3044\u3064\u3082\u4f7f\u3063\u3066\u3044\u308b\u3068\u624b\u7656\u3067\u5373\u524a\u9664\u3057\u3066\u3057\u307e\u3063\u305f\u308a\u3057\u3066\u78ba\u5b9f\u3067\u306f\u3042\u308a\u307e\u305b\u3093\uff0eGUI\u74b0\u5883\u306e\u30d5\u30a1\u30a4\u30e9\u30fc\u306a\u3069\u3067\u306f\u30b4\u30df\u7bb1\u6a5f\u80fd\u304c\u4f7f\u3048\u3066\u524a\u9664\u3057\u3066\u3082\u30b4\u30df\u7bb1\u3092\u7a7a\u306b\u3059\u308b\u307e\u3067\u5fa9\u5143\u304c\u53ef\u80fd\u3067\u3059\uff0e<br \/>\n\u3053\u308c\u3092cui\u3067\u3082\u5229\u7528\u3067\u304d\u308b trash-cli \u3068\u3044\u3046\u30c4\u30fc\u30eb\u304c\u3042\u308a\u307e\u3059\uff0e\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u3068\u5171\u901a(freedesktop.org trashcan\u3068\u5171\u901a)\u306e\u30b4\u30df\u7bb1\u304c\u4f7f\u3048\u3066\u4fbf\u5229\u3067\u3059\uff0e<\/p>\n<\/div>\n<div id=\"__asciidoctor-preview-2__\" class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/andreafrancia\/trash-cli\">GitHub &#8211; andreafrancia\/trash-cli: Command line interface to the freedesktop.org trashcan.<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.freedesktop.org\/wiki\/Specifications\/trash-spec\/\">trash-spec<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<div id=\"__asciidoctor-preview-3__\" class=\"paragraph\">\n<p>\u524a\u9664\u3057\u3066\u3057\u307e\u3063\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u5fa9\u5143\u3057\u305f\u3044\u5834\u5408\u306a\u308b\u3079\u304f\u65e9\u304f\u524a\u9664\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092 umount or mount -o ro \u3057\u3066\u30d5\u30a1\u30a4\u30eb\u5fa9\u5143\u30c4\u30fc\u30eb\u3092\u8a66\u3057\u3066\u307f\u308b\u3068\u3082\u3057\u304b\u3057\u305f\u3089\u5fa9\u5143\u3067\u304d\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff0eDebian \u306e\u5834\u5408 forensics-all\/forensics-extra pkg \u7b49\u3092\u8997\u3044\u3066\u307f\u308b\u3068\u69d8\u3005\u306a\u30c4\u30fc\u30eb\u304c\u898b\u3064\u304b\u308b\u3068\u601d\u3044\u307e\u3059\uff0e(\u4f8b\u3048\u3070ext3\/ext4\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3067\u306e\u5fa9\u5143\u30c4\u30fc\u30eb\u306eextundelete\u3084\u6c4e\u7528\u306escalpel\u7b49)<\/p>\n<\/div>\n<div id=\"__asciidoctor-preview-4__\" class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/packages.debian.org\/stretch\/forensics-all\">Debian\u2009\u2014\u2009stretch \u306e forensics-all \u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u95a2\u3059\u308b\u8a73\u7d30<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/packages.debian.org\/stretch\/forensics-extra\">Debian\u2009\u2014\u2009stretch \u306e forensics-extra \u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u95a2\u3059\u308b\u8a73\u7d30<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<div id=\"__asciidoctor-preview-5__\" class=\"listingblock\">\n<div class=\"title\">\u5c0e\u5165<\/div>\n<div class=\"content\">\n<pre>$ sudo apt install trash-cli\r\n$ dpkg -L trash-cli|grep bin\/\r\n\/usr\/bin\/restore-trash\r\n\/usr\/bin\/trash\r\n\/usr\/bin\/trash-empty\r\n\/usr\/bin\/trash-list\r\n\/usr\/bin\/trash-put\r\n\/usr\/bin\/trash-rm<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-6__\" class=\"listingblock\">\n<div class=\"title\">trash \u30b4\u30df\u7bb1\u306b\u6368\u3066\u308b<\/div>\n<div class=\"content\">\n<pre>$ touch hoge  #\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210\r\n$ trash hoge  #\u30d5\u30a1\u30a4\u30eb\u3092\u6368\u3066\u308b\r\n$ mkdir -p hoge\/fuga\/piyo #\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4f5c\u6210\r\n$ trash hoge  #\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u6368\u3066\u308b<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-7__\" class=\"listingblock\">\n<div class=\"title\">trash-list \u30b4\u30df\u7bb1\u306e\u4e2d\u3092\u898b\u308b(\u540c\u3058\u5834\u6240\u540c\u3058\u540d\u524d\u306e\u30d5\u30a1\u30a4\u30eb\u3082\u305d\u308c\u305e\u308c\u7ba1\u7406\u3055\u308c\u308b)<\/div>\n<div class=\"content\">\n<pre>$ trash-list | grep hoge\r\n2018-09-11 05:36:19 \/home\/matoken\/tmp\/hoge\r\n2018-09-12 08:57:31 \/home\/matoken\/tmp\/hoge\r\n2018-09-12 08:37:09 \/home\/matoken\/tmp\/hoge\r\n2018-09-12 08:57:35 \/home\/matoken\/tmp\/hoge\r\n2018-09-12 08:36:56 \/home\/matoken\/tmp\/hoge\r\n2018-09-11 05:36:34 \/home\/matoken\/tmp\/hoge<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-8__\" class=\"listingblock\">\n<div class=\"title\">trash-empty \u30b4\u30df\u7bb1\u3092\u7a7a\u306b\u3059\u308b<\/div>\n<div class=\"content\">\n<pre>$ trash-empty\r\n$ trash-list<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-9__\" class=\"listingblock\">\n<div class=\"title\">restore-trash \u5bfe\u8a71\u7684\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u5fa9\u5143\u3059\u308b<\/div>\n<div class=\"content\">\n<pre>$ restore-trash\r\n   0 2018-09-14 05:15:11 \/home\/matoken\/tmp\/piyo\r\n   1 2018-09-14 05:13:22 \/home\/matoken\/tmp\/hoge\r\n   2 2018-09-14 05:15:11 \/home\/matoken\/tmp\/fuga\r\nWhat file to restore [0..2]: 0  #\u5fa9\u5143\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u306e\u756a\u53f7\u3092\u6307\u5b9a<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-10__\" class=\"listingblock\">\n<div class=\"title\">trash \u3092 rm \u306e alias \u306b\u3059\u308b(alias \u306b\u3066\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u4e0e\u3057\u3066\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u7121\u8996\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b)<\/div>\n<div class=\"content\">\n<pre>$ alias rm='trash'\r\n$ rm hoge\r\n$ rm -rf dir<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-11__\" class=\"paragraph\">\n<p>\u3068\u3044\u3046\u611f\u3058\u3067\u7c21\u5358\u306b\u4f7f\u3048\u307e\u3059\uff0esudo \u3092\u4f7f\u3046\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\uff0e\u30b4\u30df\u7bb1\u306e\u5b9f\u4f53\u306f\u74b0\u5883\u306b\u3088\u308a\u307e\u3059\u304c\uff0c\u624b\u5143\u306e\u74b0\u5883\u3067\u306f ~\/.local\/share\/Trash\/ \u4ee5\u4e0b\u3067\u3057\u305f\uff0e\u3053\u306e\u3042\u305f\u308a\u306f\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u304c\u53c2\u8003\u306b\u306a\u308b\u3068\u601d\u3044\u307e\u3059\uff0e<\/p>\n<\/div>\n<div id=\"__asciidoctor-preview-12__\" class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/www.freedesktop.org\/wiki\/Specifications\/basedir-spec\/\">basedir-spec<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<div id=\"__asciidoctor-preview-13__\" class=\"paragraph\">\n<p>\u30b4\u30df\u7bb1\u3092\u7a7a\u306b\u3057\u306a\u3044\u3068\u3069\u3093\u3069\u3093\u30d5\u30a1\u30a4\u30eb\u306f\u6e9c\u307e\u3063\u3066\u3044\u304d\u307e\u3059\uff0eautotrash \u3092\u4f7f\u3063\u3066\u6383\u9664\u3059\u308b\u306e\u304c\u304a\u3059\u3059\u3081\u3067\u3059\uff0e<\/p>\n<\/div>\n<div id=\"__asciidoctor-preview-14__\" class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/matoken.org\/blog\/2018\/09\/12\/automatic-cleaning-of-trash-can-with-autotrash\/\">autotrash \u3067\u30b4\u30df\u7bb1\u3092\u81ea\u52d5\u6e05\u6383 \u2013 matoken\u2019s meme<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<div id=\"__asciidoctor-preview-111__\" class=\"paragraph\">\n<div id=\"__asciidoctor-preview-111__\" class=\"paragraph\">\n<p>\uff1c\u8ffd\u8a18\uff1e<\/p>\n<\/div>\n<div id=\"__asciidoctor-preview-112__\" class=\"paragraph\">\n<p>Google+\u306e\u30b3\u30e1\u30f3\u30c8\u3067<a href=\"https:\/\/plus.google.com\/116610290658604786185\">masaka<\/a>\u3055\u3093\u306b\u6559\u3048\u3066\u3082\u3089\u3063\u305f\u306e\u3067\u3059\u304c\uff0c<code style=\"font-family: monospace;\">trash-empty \u65e5\u4ed8<\/code> \u3068\u65e5\u4ed8\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u65e5\u4ed8\u4ee5\u4e0a\u306e\u65e5\u6570\u304c\u7d4c\u904e\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u304c\u524a\u9664\u3067\u304d\u308b\u3088\u3046\u3067\u3059\uff0e\u65e5\u4ed8\u6307\u5b9a\u3060\u3051\u306a\u3089autotrash \u3092\u5c0e\u5165\u3057\u306a\u304f\u3066\u3082\u3044\u3044\u3067\u3059\u306d\uff0e<\/p>\n<\/div>\n<div id=\"__asciidoctor-preview-113__\" class=\"quoteblock\">\n<div class=\"title\"><a href=\"https:\/\/plus.google.com\/+KenichiroMATOHARA\/posts\/jLdmgiHWChT\">&#8220;trash-cli \u3067 cli \u3067\u3082\u30b4\u30df\u7bb1\u5229\u7528 \u2013 matoken\u2019s meme&#8221; https:\/\/matoken.org\/blog\/2018\/09\/1\u2026\u200b<\/a><\/div>\n<blockquote>\n<div id=\"__asciidoctor-preview-114__\" class=\"paragraph\">\n<p>Masakazu Takahashi<\/p>\n<\/div>\n<div id=\"__asciidoctor-preview-115__\" class=\"paragraph\">\n<p>\u3061\u306a\u307f\u306btrash-cli\u3067\u3082`trash-empty 30`\u3068\u304b\u5b9f\u884c\u3059\u308b\u3068\u3001\u524a\u9664\u3057\u306630\u65e5\u8d85\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30b4\u30df\u7bb1\u304b\u3089\u6d88\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<\/div>\n<\/blockquote>\n<\/div>\n<div id=\"__asciidoctor-preview-116__\" class=\"listingblock\">\n<div class=\"title\">man trash-empty\u3088\u308a<\/div>\n<div class=\"content\">\n<pre>ARGUMENTS\r\n       To remove all trashed files, use 'emtpy-trash'.\r\n\r\n       To remove files that have been in the trash more than a given number of\r\n              days, use 'trash-empty x', 'x' representing the number of days.<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-117__\" class=\"paragraph\">\n<p>\uff1c\uff0f\u8ffd\u8a18\uff1e<\/p>\n<\/div>\n<div id=\"__asciidoctor-preview-15__\" class=\"listingblock\">\n<div class=\"title\">\u74b0\u5883<\/div>\n<div class=\"content\">\n<pre>$ dpkg-query -W trash-cli\r\ntrash-cli       0.12.9.14-2.1\r\n$ lsb_release -d\r\nDescription:    Debian GNU\/Linux unstable (sid)\r\n$ uname -m\r\nx86_64<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-16__\" class=\"paragraph\">\n<p>\uff03trash-cli \u306f\u73fe\u5728 0.17.1.14 \u3067 0.12.9.14 \u306e\u30ea\u30ea\u30fc\u30b9\u65e5\u306f 15 Sep 2012 \u3068\u306a\u3063\u3066\u3044\u308b\uff0e<\/p>\n<\/div>\n<div id=\"__asciidoctor-preview-17__\" class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/bugs.debian.org\/cgi-bin\/bugreport.cgi?bug=856814\">#856814 &#8211; Package trash-cli needs to be updated with newest version &#8211; Debian Bug report logs<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>rm \u30b3\u30de\u30f3\u30c9\u306f\u3068\u3066\u3082\u5f37\u529b\u3067\u3059\uff0e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3082\u306a\u304f\u8aa4\u3063\u3066\u524a\u9664\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u5fa9\u65e7\u3067\u304d\u306a\u3044\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u3067\u3059\uff0e \u305d\u3053\u3067 rm \u306e alias \u306b rm -i \u3092\u6307\u5b9a\u3057\u3066\u78ba\u8a8d\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u3059\u306a\u3069\u3057\u3066\u3044\u308b\u74b0\u5883\u3082\u3042\u308a\u307e\u3059\u304c\uff0c\u3044\u3064\u3082\u4f7f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[7,6,199],"tags":[394,395,396],"class_list":["post-2110","post","type-post","status-publish","format-standard","hentry","category-debian-linux","category-linux","category-sid","tag-autotrash","tag-trash-can","tag-trash-cli"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/2110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=2110"}],"version-history":[{"count":0,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/2110\/revisions"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=2110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=2110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=2110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}