Command Line trash

Related Articles

One of the first commands you learn when experimenting with a command line is rm, Utility for deleting files and directories. Deletion is a core user interface operation of the computer, but operating systems use the “garbage” paradigm, in which files are stored before they are actually deleted. with the rm Utility, however, files are deleted immediately and permanently.

If you’re like me and afraid to automate file deletion permanently, you can opt in A utility called trash. This nice Node.js directory transfers files to the trash instead of instant deletion.

// Install with `yarn add trash`

// Move a file to trash
const trash = require('trash');
await trash('bug-report.jpg');

There are also a trash-cli Package for using the command line utility:

yarn add trash-cli

# Usage
trash unicorn.png rainbow.png
trash '*.png' '!unicorn.png'

rm Can be really hard so there is a trash The utility is helpful in providing users with a file deletion paradigm that they are used to.

  • Convert XML to JSON with JavaScript
  • Page Visibility API

    Page Visibility API

    One event that has always been missing in a document is a signal for the time when the user is looking at a given tab, or another tab. When does the user turn off our site to look at something else? When are they coming back?



Please enter your comment!
Please enter your name here

Popular Articles