Code Monkey home page Code Monkey logo

trash's Introduction

trash

Move files and folders to the trash

Works on macOS (10.12+), Linux, and Windows (8+).

Note: The Linux implementation is not very good and not maintained. Help welcome. If no one steps up to help maintain it, I will eventually remove Linux support.

In contrast to fs.unlink, del, and rimraf which permanently delete files, this only moves them to the trash, which is much safer and reversible.

Install

npm install trash

Usage

import trash from 'trash';

await trash(['*.png', '!rainbow.png']);

API

trash(input, options?)

Returns a Promise.

input

Type: string | string[]

Accepts paths and glob patterns.

options

Type: object

glob

Type: boolean
Default: true

Enable globbing when matching file paths.

CLI

To install the trash command, run:

npm install --global trash-cli

Info

On macOS, macos-trash is used.
On Linux, the XDG spec is followed.
On Windows, recycle-bin is used.

FAQ

But I can do the same thing with mv

Not really. The mv command isn't cross-platform and moving to trash is not just about moving the file to a "trash" directory. On all OSes you'll run into file conflicts. The user won't easily be able to restore the file. It won't work on an external drive. The trash directory location varies between Windows versions. For Linux, there's a whole spec you need to follow. On macOS, you'll lose the Put back feature.

Related

trash's People

Contributors

arthurvr avatar bendingbender avatar bolajiayodeji avatar brandon93s avatar daleeidd avatar fregante avatar gsittyz avatar ivolimasilva avatar jdalton avatar jdanford avatar kevva avatar konsumer avatar linusu avatar medusalix avatar mickvangelderen avatar mofux avatar nocke avatar ntwb avatar omnidan avatar papb avatar richienb avatar samverschueren avatar sindresorhus avatar stroncium avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trash's Issues

Not working on linux systems where python defaults to python3

$ touch test
$ trash test
Command failed: Traceback (most recent call last):
  File "./trash-put", line 4, in <module>
    from trashcli.put import main
  File "/home/despairblue/node_modules/trash/vendor/trash-cli/trashcli/put.py", line 255
    except (IOError, OSError), error:
                             ^
SyntaxError: invalid syntax

Why ?

Seriously, why ?
Why in nodejs ?

You lost a bet ?
Got to high with drugs ?

upgrading to 3.0 usability feedback

Hi @sindresorhus, I ran into a small problem upgrading trash tonight. I thought I'd provide you what was going through my head in case you start hearing about issues from others who aren't as interesting in giving all of the details, and if you are interested in making changes to simplify the transition.

What happened:

Hmm, I want to get rid of this pesky node_modules directory in my test fixtures.

❯ trash node_modules


┌──────────────────────────────────────────┐
│ Update available: 3.0.0 (current: 2.0.0) │
│ Run npm install -g trash to update.      │
└──────────────────────────────────────────┘

Fun, let's upgrade!

 ❯ npm -g i trash
npm WARN deprecated [email protected]: Deprecated in favor of the `trash` module
npm WARN deprecated [email protected]: Deprecated in favor of the `trash` module
npm WARN deprecated [email protected]: Deprecated in favor of the `trash` module
[email protected] /Users/dgreene/.nvm/versions/node/v4.1.2/lib/node_modules/trash
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
previous command took 5s.

Well that's strange, I'm installing the latest version of trash but it's in turn installing node modules that say they are deprecated, and they want me instead to install trash, which is what I thought I was doing.

Oh well, probably just a glitch in the matrix, these things happen.

❯ trash node_modules
zsh: command not found: trash

Hmm, what did I break?

After re-installing a few times, checking my version of Node, npm, trying npm-check -g, I run changelog on trash:

❯ changelog trash
3.0.0 / 2015-10-13
  * 3.0.0
  * minify images further
  * extract CLI into a separate module
    https://github.com/sindresorhus/trash-cli
  * tweaks
  * Close https://github.com/sindresorhus/trash/issues/35 PR: Use promises and ES2015ify tests.
  * fix logo

ooooh! new trash-cli. I think I saw that on twitter.

❯ npm i -g trash-cli
npm WARN deprecated [email protected]: Deprecated in favor of the `trash` module
npm WARN deprecated [email protected]: Deprecated in favor of the `trash` module
npm WARN deprecated [email protected]: Deprecated in favor of the `trash` module
/Users/dgreene/.nvm/versions/node/v4.1.2/bin/trash -> /Users/dgreene/.nvm/versions/node/v4.1.2/lib/node_modules/trash-cli/cli.js
[email protected] /Users/dgreene/.nvm/versions/node/v4.1.2/lib/node_modules/trash-cli
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected])
previous command took 7s.

Hmm, it's still telling me I should be using trash. But I just tried that and it didn't work.

 ❯ trash node_modules
 ❯ 

Unexpected success!

Is there a better way to handle upgrades to make it more clear to users what needs to be done?

I'm guessing most users don't know about changelog and might not take the time to look through the git history.

If you think this is an issue with update-notifier I can create a new feature request there instead.

File disappear when using sudo in OSX

When I want to delete a folder or file in OSX that requires extra permissions Trash refuses to do so and prints an error message. It is to be expected of course. But when I try to get around this by using sudo the file just disappears instead of being moved to the trash. Is this supposed to happen?

Error: spawn EACCES

I'm getting following error on macOS 10.12.6:

Error: spawn EACCES
    at _errnoException (util.js:1041:11)
    at ChildProcess.spawn (internal/child_process.js:325:11)
    at exports.spawn (child_process.js:493:9)
    at exports.execFile (child_process.js:208:15)
    at X/nodejs/myapp/node_modules/pify/index.js:29:7
    at Promise (<anonymous>)
    at X/nodejs/myapp/node_modules/pify/index.js:12:10
    at ret (X/nodejs/myapp/node_modules/pify/index.js:56:34)
    at module.exports.paths (X/nodejs/myapp/node_modules/trash/lib/macos.js:38:23)
    at module.exports.iterable (X/nodejs/myapp/node_modules/trash/index.js:20:25) code: 'EACCES', errno: 'EACCES', syscall: 'spawn' }

I could solve the issue by setting the execute bit on trash/lib/macos-trash like so:

chmod +x ./node_modules/trash/lib/macos-trash

Node version: 8.4.0
npm version: 5.4.0

Error when filename contains parenthesis

{ [Error: Command failed: /bin/sh -c df -kP /home/romgrk/github/filrk/bar(2).txt
/bin/sh: 1: Syntax error: "(" unexpected
]
  killed: false,
  code: 2,
  signal: null,
  cmd: '/bin/sh -c df -kP /home/romgrk/github/filrk/bar(2).txt' } 

I am on linux, therefore using xdg-trash.

xdg-trash 404

Hi I just tried to install this from npm and one of your dependencies xdg-trash is not found. I've removed this dependency locally but it would be great if this could be resolved.

--force option

I would like trash to not retval 1 for missing files with an option (like rm -rf) this would allow trash --force build/ in npm scripts for cross-platform no-task-runner scenarios. Happy to PR, if this is an idea you like.

Recommend alias rm=trash in README

If you install this CLI tool to be safer, you'd better go all the way and alias rm to trash. You could still call original rm with \rm.

Invalid name: "@sindresorhus/df" trying to install on OSX.

$ npm install  trash
npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead!
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "trash"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8

npm ERR! Invalid name: "@sindresorhus/df"
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/ematiu/devel/kk/npm-debug.log

install failed on Mac ~-~

like this
➜ ~ npm install --save trash
npm WARN saveError ENOENT: no such file or directory, open '/Users/rayjune/package.json'
/Users/rayjune
└── [email protected]

npm WARN enoent ENOENT: no such file or directory, open '/Users/rayjune/package.json'
npm WARN rayjune No description
npm WARN rayjune No repository field.
npm WARN rayjune No README data
npm WARN rayjune No license field.

Can't install via `npm install`, get 404 not found.

I'm not sure if this is a problem with npm or trash itself but every time I try to install trash, I get a 404 not found:

astronaut [repo] git:(master*) $ npm install --save-dev trash
npm ERR! 404 Not Found
npm ERR! not ok code 0

If I run an npm info trash, I get:

astronaut [repo] git:(master*) $ npm info trash

{ name: 'trash',
  description: 'Cross-platform command-line app for moving files and directories to the trash - A safer alternative to `rm`',
  'dist-tags': { latest: '2.0.0' },
  versions:
   [ '0.1.0',
     '0.1.1',
     '0.1.2',
     '1.0.0',
     '1.1.0',
     '1.1.1',
     '1.1.2',
     '1.1.3',
     '1.2.0',
     '1.3.0',
     '1.3.1',
     '1.4.0',
     '1.4.1',
     '2.0.0' ],
  maintainers:
   [ 'sindresorhus <[email protected]>',
     'kevva <[email protected]>' ],
  time:
   { modified: '2015-08-03T20:36:07.379Z',
     created: '2014-05-14T17:33:44.457Z',
     '0.1.0': '2014-05-14T17:33:44.457Z',
     '0.1.1': '2014-05-14T23:11:10.431Z',
     '0.1.2': '2014-05-17T14:03:12.265Z',
     '1.0.0': '2014-08-02T21:43:37.603Z',
     '1.1.0': '2014-08-05T17:20:38.114Z',
     '1.1.1': '2014-08-18T18:20:57.360Z',
     '1.1.2': '2014-09-07T10:24:09.887Z',
     '1.1.3': '2014-09-29T11:18:00.403Z',
     '1.2.0': '2014-10-14T15:47:35.589Z',
     '1.3.0': '2014-12-25T15:10:30.684Z',
     '1.3.1': '2015-01-19T06:07:55.374Z',
     '1.4.0': '2015-01-26T08:22:53.141Z',
     '1.4.1': '2015-02-16T18:03:44.868Z',
     '2.0.0': '2015-08-03T20:36:07.379Z' },
  homepage: 'https://github.com/sindresorhus/trash',
  keywords:
   [ 'cli-app',
     'cli',
     'bin',
     'trash',
     'recycle',
     'rm',
     'remove',
     'delete',
     'file',
     'files',
     'dir',
     'directory',
     'directories',
     'shell',
     'script' ],
  repository:
   { type: 'git',
     url: 'https://github.com/sindresorhus/trash' },
  author: 'Sindre Sorhus <[email protected]> (sindresorhus.com)',
  bugs: { url: 'https://github.com/sindresorhus/trash/issues' },
  license: 'MIT',
  readmeFilename: 'readme.md',
  users:
   { 'julien-f': true,
     xtopher: true,
     mnova: true,
     futhorc: true,
     kentcdodds: true,
     scotttesler: true,
     nfd: true,
     awayken: true,
     pnevares: true,
     dannyfritz: true,
     ericwbailey: true,
     travm: true,
     makenova: true,
     despairblue: true },
  version: '2.0.0',
  bin: { trash: 'cli.js' },
  preferGlobal: true,
  engines: { node: '>=0.10.0' },
  scripts: { test: 'mocha' },
  files: [ 'index.js', 'cli.js' ],
  dependencies:
   { 'each-async': '^1.1.1',
     meow: '^3.0.0',
     'osx-trash': '^1.0.1',
     'path-exists': '^1.0.0',
     'update-notifier': '^0.3.0',
     'win-trash': '^1.0.1',
     'xdg-trash': '^1.0.0' },
  devDependencies:
   { mocha: '*',
     'path-exists': '^1.0.0' },
  gitHead: '1b675632274474ba8797a9c82ebb462d0c58b33e',
  dist:
   { shasum: '66ae65dcc77d3a0325aa7372cfbc253f85cc0967',
     tarball: 'http://registry.npmjs.org/trash/-/trash-2.0.0.tgz' },
  directories: {} }

This is even after running an npm cache clean. I can also successfully install other packages.

Add ability to disable glob matching

I already know the files or folders I want to delete, so I simply pass them to trash in an array. Fine. Now consider this:

touch "test*.txt"
touch test1.txt
touch test2.txt
touch test3.txt

And guess what happens if I tell trash to remove the regular file "test*.txt", not good 😅

trash(['test*.txt'])

Therefore I would opt for an option that disables the globber and simply uses the file list I pass.
I'd like to create a PR if you're willing to accept. I propose an interface like this:

trash(['test*.txt'], { glob: false })

Error: Item doesn't exist

Mac OS 10.9.3

/Users/frank/.nvm/v0.10.21/lib/node_modules/trash/cli.js:40
        throw err;
              ^
Error: Item doesn't exist
    at /Users/frank/.nvm/v0.10.21/lib/node_modules/trash/index.js:18:14
    at ChildProcess.exithandler (child_process.js:641:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:735:16)
    at Socket.<anonymous> (child_process.js:948:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)

Trash can't find files

 ~/new  ..
 ~  trash new
/usr/bin/env: ‘node’: No such file or directory
 ✘  ~  npm install --save trash
npm WARN saveError ENOENT: no such file or directory, open '/home/abhishek/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/abhishek/package.json'
npm WARN abhishek No description
npm WARN abhishek No repository field.
npm WARN abhishek No README data
npm WARN abhishek No license field.
 ~  trash new               
/usr/bin/env: ‘node’: No such file or directory
 ✘  ~  sudo npm install --save trash
npm WARN saveError ENOENT: no such file or directory, open '/home/abhishek/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/abhishek/package.json'
npm WARN abhishek No description
npm WARN abhishek No repository field.
npm WARN abhishek No README data
npm WARN abhishek No license field.

node-v0 compatibility

$ nvm use 0
# Now using node v0.12.13 (npm v2.15.0)
$ trash hoge
# /usr/local/lib/node_modules/trash-cli/cli.js:4
#   const updateNotifier = require('update-notifier');
#   ^^^^^
# SyntaxError: Use of const in strict mode.

after hotfix...

$ trash hoge
# /usr/local/lib/node_modules/trash-cli/cli.js:9
#   const cli = meow(`
#                    ^
# SyntaxError: Unexpected token ILLEGAL

༼ ༎ຶ ෴ ༎ຶ༽

Trash multiple files won't get `put back` options on OS X

"cron1": "find ./cache/ -maxdepth 1 -type f -mtime +1d -not -name .gitignore -exec trash {} +"
"cron2": "find ./cache/ -maxdepth 1 -type f -mtime +1d -not -name .gitignore -exec trash {} \\;"

cron1 does not appear to allow put back in trash.

The only difference appear to be cron1 pass all files to trash at once, cron2 pass and run trash 1 by 1. I might be doing something wrong, but unable to spot it.

PS: since trash is silent, do you see anyway I can make this command verbose? so I can do a simple | wc -l at the end to count files?

Possible to optionally disable sound effect?

I'm using this in a build script on OSX and the paper crumple sound is a little off-putting. I like using the trash bin for speed and recovery, but would prefer to keep this functionality completely invisible.

Empty trash

Will you add something to allow for emptying the trash?
If not how about just opening a window that brings you directly to the trash?

Linux XDG Trash node module

Currently I'm using trash-cli which works fine, but it's Python dependent and slow as it's excuted in a child process.

There's a spec on how to implement "moving files to the trash" correctly.

It would be incredible if someone would be interested in writing a separate node module for this.

Let me know if you're interested ;)

hangs if you try to trash the directory you are running trash from

Steps to Reproduce

Try this..

❯ mkdir trash-me
❯ cd trash-me
❯ trash ../trash-me

At this point this dialog will come up:

screen shot 2014-09-23 at 12 47 51 pm

Problem

The trash will never exit, even if the dialog is dismissed.

❯ trash . will also hang but only if the directory has something in it.

Expected behavior

Either trash the directory or exit with an error if it's not possible.

Mention that Ubuntu server doesn't have .local folder?

I am not sure this is by design, but Ubuntu Server doesn't have .local or its Trash folder by default, how does xdg work in those cases?

I am getting this error:

> find ./cache/ -maxdepth 1 -type f -mtime +7 -not -name .gitignore -exec trash {} + && empty-trash

ENOENT: no such file or directory, scandir '/home/dev/.local/share/Trash/files'

Get stuff from the trash?

The README covers how to put stuff in the trash, is there a command to get stuff out of the trash or at least view what's in the trash?

Dynamic requirements fail

First of all, love your module. It's nice and robust, has made our lives easier.

We are trying to package our app in a node binary, saw users can use it without node. Unfortunately due the dynamic requires in your app, the trash functionality doesn't work.
When we bundle our code for production, it gets built to a binary.

Here: https://github.com/sindresorhus/trash/blob/master/index.js#L22-L24
Here: https://github.com/sindresorhus/trash/blob/master/lib/macos.js#L10
etc.

https://github.com/jaredallard/nexe#doesnt-support-dynamic-require-statements

Can you add the source code as part of the package so it can support compiled binaries?

Thanks.

Put Back not available for trashed folders on OS X

I can trash a file and then put it back using Finder, but the same doesn't seem to be true for folders. If I put a folder into the trash using Finder, Put Back works fine. But if I use trash on that same folder, Put Back isn't in the contextual menu for the folder in the Trash.

OS X 10.9.4

Don't error on missing files

I don't think it should error when the files you specified doesn't exists. It should log it, but exit with error code 0. Currently you have to use trash --force if you want to use it for cleaning up a build dist dir or something, as the directory might not exists.

So need to differentiate between missing files and actual errors. Should be easy. Just use path-exists on them. I know this is a race condition, but shouldn't matter and probably easier than checking afterwards.

Thoughts?

//@kevva @arthurvr

Accept a string

Like globby, I assumed this module accepted a string.
When I passed in '/foo/bar/car' it turned it into an array of ['/', 'f', 'o', ...] and globbed a result of of

['/', '/foo/bar/car']

The value of / was not what I wanted ⚠️.
In earlier versions trash would have thrown an error if it received a string.
However, now it silently accepts a string and happily trashes root.

The nas I'm on has limited storage on root so the trash fills up fast with no-space errors.
It also let's me muck with / without borking, restoring off another partition, so no worries.

Not able to install

I tried to install it but I get the following error

npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/trash/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/package.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 14.5.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "--global" "trash"
npm ERR! cwd /usr/local/lib/node_modules
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.21
npm ERR! path /usr/local/lib/node_modules/trash/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/package.json
npm ERR! fstream_path /usr/local/lib/node_modules/trash/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/package.json
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15)
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 'sindresorhus/df' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'mount-point'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Darwin 14.5.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "--global" "trash"
npm ERR! cwd /usr/local/lib/node_modules
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.21
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /usr/local/lib/node_modules/npm-debug.log
npm ERR! not ok code 0

Be advised that I had it working, then I updated it one day and trash stop working so I uninstalled and tried to installing it again.

Trash not working after 3.0.0 Update (Win7)

After updating to v 3.1.1 (Win7), trash is no longer working. Before the update it worked perfect when I had v2.0.0.

I get the following when trying to trash anything now.

sh.exe": /local/trash: No such file or directory

Failure during installation of trash

I'm having strange troubles with installing trash via npm

npm i trash -D

fails with the following output on the console

npm ERR! Darwin 13.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "trash" "-D"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1

npm ERR! Invalid name: "@sindresorhus/df"

I suppose that might be caused by failing to install https://github.com/sindresorhus/df I've tried installing that package directly and it fails with the same error.

Any hints on what might be causing this issue?

Trash symlinks

Under the hood trash uses an approximation of fs.exists(symlink) which will return false and so skip trashing symlinks.

Trashing a file on Ubuntu Linux deletes it unrecoverably

Issuehunt badges

On Ubuntu 16.10, when I use the command-line tool trash to delete a file, rather than a folder, the file is deleted immediately rather than appearing in the Trash where I can recover it. In other words, trash acts like rm -f when given a file.

Some commands that demonstrate the problem:

$ pwd
/home/roryokane

$ # delete files

$ touch aaaaaa.txt
$ trash aaaaaa.txt

$ touch bbbbbb.txt
$ echo "contents of bbbbbb" > bbbbbb.txt
$ trash bbbbbb.txt

$ # delete folders

$ mkdir cccccc
$ touch cccccc/foo.txt
$ echo "contents of foo" > cccccc/foo.txt
$ trash cccccc

$ mkdir dddddd
$ trash dddddd

When I look in my Trash by clicking the Trash icon in the dock/taskbar, I only see the cccccc and dddddd folders in the trash. The aaaaaa.txt and bbbbbb.txt files are missing.

Trash showing only ‘cccccc’ and ‘dddddd’

My environment

I used the xdg-trashdir package, which trash currently uses, to find the location of my Trash directories. Here is my Node session:

const xdgTrashdir = require('xdg-trashdir');
let dirs = []
xdgTrashdir.all().then(dirsInner => dirs = dirsInner)
dirs.forEach(dir => console.log(dir))

And the output:

/dev/.Trash-1000
/run/.Trash-1000
/home/roryokane/.local/share/Trash
/dev/shm/.Trash-1000
/run/lock/.Trash-1000
/sys/fs/cgroup/.Trash-1000
/snap/core/1337/.Trash-1000
/snap/keepassx-elopio/1/.Trash-1000
/snap/core/1287/.Trash-1000
/snap/core/1264/.Trash-1000
/home/roryokane/.local/share/Trash
/run/user/1000/.Trash-1000

Saving that to a file and running cat trash_dirs.txt | xargs ls showed that the only folder of those that exists is /home/roryokane/.local/share/Trash, which contains expunged/, files/, and info/. None of those folders contain files or folders with aaaaaa, bbbbbb, cccccc, or dddddd in their names. Also, when I search for those four files and folders using the Files program to search those names from the root of the disk, none of them are found.

I installed trash with Yarn:

$ which trash
/home/roryokane/.yarn-global/bin/trash
$ yarn global ls
yarn global v0.21.3
warning No license field
info "[email protected]" has binaries:
   - gitjk_cmd
   - git-jk
info "[email protected]" has binaries:
   - trash
Done in 0.61s.

IssueHunt Summary

gsittyz gsittyz has been rewarded.

Backers (Total: $60.00)

Submitted pull Requests


Tips

Move files to the proper Trash

The command:

trash /Volumes/something/abc

moves the file/directory to ~/.Trash on OS X, i.e. moves it to a different drive. It should just move the file/directory to the trash proper for the volume the file is on.

Tested on OS X Yosemite with trash 1.2.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.