Hello
I've got a small problem.
Somehow I got so amazingly much files in my Trash Can that it's impossible to delete them all in once.
The delete trash-can command also doesn't work, if I try to delete a few; my PC just stucks.
So, I need a Bash snippet which will delete ONE file at a time from my Trash Can, with a timeout of 1 second.
That way my RAM doesn't get overloaded and after letting it running a night the job will be done.
So, any Bash script that can do this?
Thanks for reading,
Niely
Bash script to empty HUGE Trash Can? [Solved]
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
Bash script to empty HUGE Trash Can? [Solved]
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Bash script to empty HUGE Trash Can?
Why not use this command:
Code: Select all
sudo rm -rf ~/.local/share/Trash/files/*
Linux Mint 21.3 Cinnamon
Re: Bash script to empty HUGE Trash Can?
Like I said it doesn't work. It must one by one with a time-span of one second.
That command just ends in terminal, but doesn't delete anything.
That command just ends in terminal, but doesn't delete anything.
Re: Bash script to empty HUGE Trash Can?
^Thanks a lot! Exactly what I needed and it's very useful + helpful.
-
- Level 2
- Posts: 88
- Joined: Tue Jun 25, 2013 8:50 pm
Re: Bash script to empty HUGE Trash Can? [Solved]
just for reference a for loop would be the way to get 1 file every second, at least is how i would do it...
Code: Select all
for i in ~/.local/share/Trash/files/* ; do
rm -rf "$i"
sleep 1
done