checks size of directory & delete it if its to small

for i in *; do test -d "$i" && ( rclone size "$i" --json -L 2> /dev/null | jq --arg path "$i" 'if .bytes < 57462360 then ( { p: $path , b: .bytes}) else "none" end' | grep -v none | jq -r '.p' | parallel -j3 rclone purge "{}" -v -P ); done
only simple example how to combine rclone & jq
Sample Output
Transferred:              0 / 0 Byte, -, 0 Byte/s, ETA -
Errors:                 1 (retrying may help)   
Deleted:                0 (files), 3 (dirs)
Elapsed time:        14.2sTransferred:                    0 / 0 Byte, -, 0 Byte/s, ETA -
Errors:                 1 (retrying may help)
Deleted:                0 (files), 3 (dirs)
Elapsed time:        14.2s
2021/07/25 11:14:04 Failed to purge: unlinkat /mnt/anime/Anime/Fansub/Basquash! (2009): input/output error

By: dbiesecke
2021-07-25 09:16:03

What Others Think

Thanks for the above command help, I was looking for this for a website. I believe some commands are very necessary to know by yourself and this is definitely one of them. One of the website's commands that I found intriguing is: Best orthodontist in Carlsbad Orthodontist Carlsbad Orthodontist in Carlsbad, CA Carlsbad orthodontist Orthodontist in Oceanside, CA Carlsbad Children’s dental care Carlsbad Orthodontics Carlsbad Pediatric Dentistry
Glide009 · 7 weeks and 6 days ago
When listing the contents of a directory utilizing the ls command, you may have seen that the size of the records is almost always 4 kb. I also used many commands for preparing my work records I'm working in a Content Writing Company in Karachi. Tools help us to make the best reports.
manihashah1 · 7 weeks and 6 days ago
A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. omegle
Robert784 · 7 weeks and 5 days ago
became a searcher,wanting to discover who i was and what made me precise. my view of myself turned into changing. i desired a stable base to start from. i commenced to resist3 stress to behave in ways that i didn’t like any greater,and i used to be delighted by who i in reality become. i got here to feel a good deal extra sure that no one can ever take my region.
getnewrevv · 7 weeks and 4 days ago
getnewrevv · 7 weeks and 4 days ago
how to get sponsored for running [url=]seo optimization company[/url] ref=
getnewrevv · 7 weeks and 4 days ago
how to get sponsored for running [url=]seo optimization company[/url] ref=
getnewrevv · 7 weeks and 4 days ago
Your site is very sexy">">">">">">">">">">">
irfan45 · 7 weeks and 4 days ago
You Can Also Download Free Software & Mac
javed672 · 7 weeks and 4 days ago
GotoAssignmentHelp is Assignment Help Company providing writing services in world. We always look customer satisfaction rather than demanding only money.
annybank2018 · 7 weeks and 3 days ago
Thanks for sharing, I found a lot of interesting information here. A really good post, very thankful and helpful. MyLowesLife
timothy_87 · 7 weeks ago
While research has shown comparable withdrawal reactions is marijuana users as in alcohol or other drugs (Ashton, 2001), what I have witnessed many times in my personal interaction with clients is the apparent lack of withdrawal experienced by most marijuana users. Of course they experience cravings, but they don't report having the same neurophysical withdrawal reaction that the other drug users have. Some marijuana smokers use this as their final proof that marijuana "is not a drug" and they should therefore not be subjugated to the same treatment and pursuit of recovery efforts as other drug or alcohol abusers.
robinjack · 6 weeks and 4 days ago
The command can I execute to check the directories inside a folder and if the total size of the directory is smaller than 30MB, delete it? I played around with the find command trying to move files based in the size but it didn't work properly. DGCustomerFirst
Kemmer · 5 weeks and 3 days ago
Awesome Code Mortgage Lender in Austin
Modernhomes07 · 5 weeks ago
Thank you for sharing; I discovered a lot of useful stuff here. A fantastic article that is both appreciative and useful. among us
kanejoyce · 4 weeks and 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: