- Thread: which path does the trash have?
- which path does the trash have?
- Re: which path does the trash have?
- Re: which path does the trash have?
- Re: which path does the trash have?
- Re: which path does the trash have?
- Re: which path does the trash have?
- Re: which path does the trash have?
- Re: which path does the trash have?
- Re: which path does the trash have?
- Re: which path does the trash have?
- cannot find Trash folder! Ubuntu 18.04
- 2 Answers 2
- Trash-Cli : Command line interface for Trash in Linux
- What is Trash-Cli
- How to install Trash-Cli in Linux
- How to use Trash-Cli
- Delete Files Using the Linux Command Line
- Use ‘rm’ or ‘trash-cli’ to remove files from a shell prompt
- What to Know
- The ‘rm’ Command
- How to List the Files in the Trash Can
- How to Restore Files From the Trash Can
- How to Empty the Trash Can
- Trash-cli – A Trashcan Tool to Manage ‘Trash’ from Linux Command Line
- How to Install Trash-cli in Linux
- How to Use Trash-cli in Linux
- If You Appreciate What We Do Here On TecMint, You Should Consider:
Thread: which path does the trash have?
Thread Tools
Display
which path does the trash have?
I want to empty the trash, but don’t have permissions to delete all files with my users.
Thus I want to access it through the terminal
Which path does the Trash have?
Re: which path does the trash have?
where XXXX is your user id.
Re: which path does the trash have?
Re: which path does the trash have?
in hardy heron (8.04) and xubuntu is:
where XXXX is your user id.
thx, with which command can I delete all files in the trash folder?
Re: which path does the trash have?
to open the file manager as super user and delete the files.(press Ctrl+H to see hidden folders)
Re: which path does the trash have?
since you mentioned before you had permissions issues you’ll either need to
be very very careful when you do this!
alternatively you can launch nautilus as root and use the gui
Re: which path does the trash have?
I tried to find the Trash folder previously with gksu, but when I am in
/ben there is no .Trash folder visible.
when using command line, ben@ben-desktop:
I see all the files.
How can I see the .Trash folder using nautilus?
since you mentioned before you had permissions issues you’ll either need to
be very very careful when you do this!
alternatively you can launch nautilus as root and use the gui
Re: which path does the trash have?
/ben there is no .Trash folder visible.
when using command line, ben@ben-desktop:
I see all the files.
How can I see the .Trash folder using nautilus?
Ctrl+H or select the Show Hidden Files from the View menu.
Re: which path does the trash have?
sry, there is no Trash folder visible, using 7.10
1. gksu nautilus > file browser
2. CTRL H
3. File System > Home > ben : no folder Trash, however with:
— I can list all files.
So: How could I see the content of this folder as root in Nautilus?
Re: which path does the trash have?
sry, there is no Trash folder visible, using 7.10
1. gksu nautilus > file browser
2. CTRL H
3. File System > Home > ben : no folder Trash, however with:
— I can list all files.
So: How could I see the content of this folder as root in Nautilus?
Источник
cannot find Trash folder! Ubuntu 18.04
I am running a preinstalled version of ubuntu 18.04 but cannot find Trash folder. The typical places don’t have the folder.
The directory should most likely be here but it’s not
Hmm . so I ran a search as follows:
The output was not nice:
and that’s it! By
I meant there are various directories ending with /trash. But that’s useless to mention anyhow since we are not really finding the TRASH can.
(Note that I do see a Trash bin on my Desktop, which is ironic. And yes it is empty.)
Question is, where is my TRASH FOLDER ? And why do I receive the following output when I run the find command
2 Answers 2
The trash folder in your home directory is generated once a file from the same device that your home directory is stored on gets moved to the trash. In case you’re deleting a file from another device, e.g. a different hard drive or USB stick, Ubuntu will use the (insert mountpoint)/Trash-(insert uid) directory. This is specified in FreeDesktop.org Trash Specification.
Open terminal either via Ctrl+Alt+T shortcut key, or by searching for ‘terminal’ from app launcher.
Run command to create and edit an empty file called trash.sh :
When the file opens, paste following lines and save it.
Make the script file executable and run it via the 2 commands:
Search for ‘trash’ in software launcher and select Add to Favorites in its context menu.
Finally open Startup Applications, click Add to add a new startup app. In the modal in the Name field add trash icon and in the Command field add /home/YOUR_USER_NAME/Documents/trash.sh -d
Reboot Ubuntu, and the trash can icon will change when it’s empty or not empty.
Источник
Trash-Cli : Command line interface for Trash in Linux
Everyone knows about Trashcan which is common for all users like Linux, or Windows, or Mac. Whenever you delete a file or folder, it will be moved to trash.
Note that moving files to the trash does not free up space on the file system until the Trashcan is empty.
Trash stores deleted files temporarily which help us to restore when it’s necessary, if you don’t want these files then delete it permanently (empty the trash).
Make sure, you won’t find any files or folders in the trash when you delete using rm command. So, think twice before performing rm command. If you did a mistake that’s it, it’ll go away and you can’t restore back. since metadata is not stored on disk nowadays.
Trash is a feature provided by the desktop manager such as GNOME, KDE, and XFCE, etc, as per freedesktop.org specification. when you delete a file or folder from file manger then it will go to trash and the trash folder can be found @ $HOME/.local/share/Trash .
Trash folder contains two folder files & info . Files folder stores actual deleted files and folders & Info folder contains deleted files & folders information such as file path, deleted date & time in separate file.
You might ask, Why you want CLI utility When having GUI Trashcan, most of the NIX guys (including me) play around CLI instead of GUI even though when they working GUI based system. So, if some one looking for CLI based Trashcan then this is the right choice for them.
What is Trash-Cli
trash-cli is a command line interface for Trashcan utility compliant with the FreeDesktop.org trash specifications. It stores the name, original path, deletion date, and permissions of each trashed file.
How to install Trash-Cli in Linux
Trash-Cli is available on most of the Linux distribution official repository, so run the following command to install.
For Debian/Ubuntu , use apt-get command or apt command to install Trash-Cli.
For RHEL/CentOS , use YUM Command to install Trash-Cli.
For Fedora , use DNF Command to install Trash-Cli.
For Arch Linux , use Pacman Command to install Trash-Cli.
For openSUSE , use Zypper Command to install Trash-Cli.
If you distribution doesn’t offer Trash-cli, we can easily install from pip. Your system should have pip package manager, in order to install python packages.
How to use Trash-Cli
It’s not a big deal since it’s offering native syntax, provides following commands.
- trash-put: Delete files and folders.
- trash-list: Pint Deleted files and folders.
- trash-restore: Restore a file or folder from trash.
- trash-rm: Remove individual files from the trashcan.
- trash-empty: Empty the trashcan(s).
Let’s try some examples to experiment this.
1) Delete files and folders : In our case, we are going to send a file named 2g.txt and folder named magi to Trash by running following command.
You can see the same in file manager.
2) Pint Delete files and folders : To view deleted files and folders, run the following command. As I can see detailed information about deleted files and folders such as name, date & time, and file path.
3) Restore a file or folder from trash : At any point of time you can restore a files and folders by running following command. It will ask you to enter the choice which you want to restore. In our case, we are going to restore 2g.txt file, so my option is 0 .
4) Remove individual files from the trashcan : If you want to remove specific files from trashcan, run the following command. In our case, we are going to remove magi folder.
5) Empty the trashcan : To remove everything from the trashcan, run the following command.
6) Remove older then X days file : Alternatively you can remove older then X days files so, run the following command to do it. In our case, we are going to remove 10 days old items from trashcan.
trash-cli works great but if you want to try alternative, give a try to gvfs-trash & autotrash
Источник
Delete Files Using the Linux Command Line
Use ‘rm’ or ‘trash-cli’ to remove files from a shell prompt
What to Know
- Use the rm command, rm /path/to/file, to permanently delete a file. Add the -R flag to delete all the files in a folder.
- Use the trash-cli application to provide a command line trash can. Enter the command line trash /path/to/file to move files there.
This article explains two ways to safely delete files using the Linux command line. One method permanently deletes the files. The other moves them to a trash can where they can be viewed and restored.
The ‘rm’ Command
As with so many tasks, Linux offers more than one way to get a job done, with each solution having varying pros and cons. The typical method of removing a file using a shell prompt entails the rm command, although the trash-cli command works, too.
Most people use the rm command to delete files. The syntax of the rm command is as follows:
The file is not fully deleted but instead sent to a trash can in the same way as the Windows recycle bin. If you supply the trash command a folder name, it sends the folder and all the files in the folder to the recycle bin.
How to List the Files in the Trash Can
To list the files in the trash, run the following command:
The results returned include the original path to the file, and the date and time the files were sent to the trash can.
How to Restore Files From the Trash Can
To restore a file, use the following command:
You may, however, receive a command not found error if you run this command.
The alternative to trash-restore is restore-trash, as follows:
The restore-trash command lists all the files in the trash with a number next to each one. To restore a file, enter the number next to the filename.
How to Empty the Trash Can
The main issue with the trash can approach is that the deleted files take up drive space. If you are satisfied that everything in the trash can is no longer required, run the following command to empty the trash:
If you want to delete all the files that have been in the trash for a certain number of days, specify that number with the trash-empty command.
Источник
Trash-cli – A Trashcan Tool to Manage ‘Trash’ from Linux Command Line
Trash-cli is a command line interface that trashes files and records the original absolute path, deletion date, and associated permissions. It uses the same trashcan used by popular Linux desktop environments such as KDE, GNOME, and XFCE which can be invoked from the command line (and via scripts).
Trash-cli provides these commands:
In this article, we will show you how to install and use trash-cli to find the original path, deletion date, and permissions of deleted files in Linux.
How to Install Trash-cli in Linux
The straightforward way of installing trash-cli is by using easy_install tool as follows:
Else, install Trash-cli from source as shown.
How to Use Trash-cli in Linux
To trash a specific file, run.
List all trashed files.
Search for a file in the trashcan.
Restore a trashed file.
Remove all files from the trashcan.
Remove only the files that have been deleted more than ago:
Here is a demonstration of this command:
Remove only files matching a pattern.
Do not forget to use quotes in order to protect the pattern from shell expansion:
For more information, check out Trash-cli Github repository: https://github.com/andreafrancia/trash-cli
That’s all! Do you know of any similar CLI tools for Linux? Share some info about them with us via the comment form below.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Источник