remove files progress bar

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

remove files progress bar

Max Power
Hi guys!
Is there a way to view the deleted file or a progress bar
while you're erasing them?

Thanks for Your reply.

Reply | Threaded
Open this post in threaded view
|

Re: remove files progress bar

Raul Miller
On Sun, Apr 3, 2016 at 2:57 AM, Max Power <[hidden email]> wrote:
> Hi guys!
> Is there a way to view the deleted file or a progress bar
> while you're erasing them?
>
> Thanks for Your reply.

Do you mean like this?

yes | rm -i ./* 2>&1 | sed 's/remove //g; s/\?//g' |fmt

If that kind of behavior is what you want, you could make that command
line into a shell script, replacing the ./* with "$@". This would
allow you to use it with xargs, for example (though, for xargs, you
might also want to remove the |fmt and pipe the result of xargs to
fmt...).

If you want something different, I guess you would have to be a bit
clearer on what you are asking for.

Thanks,

--
Raul

Reply | Threaded
Open this post in threaded view
|

Re: remove files progress bar

Janne Johansson-3
One could rsync -avP --delete-during /var/empty /dir/to/clean/ also if you
like to see a list of files flash by.
Or something with find ... -exec rm {} + and later something to clean out
links, sockets and/or dirs.


2016-04-03 9:39 GMT+02:00 Raul Miller <[hidden email]>:

> On Sun, Apr 3, 2016 at 2:57 AM, Max Power <[hidden email]> wrote:
> > Hi guys!
> > Is there a way to view the deleted file or a progress bar
> > while you're erasing them?
> >
> > Thanks for Your reply.
>
> Do you mean like this?
>
> yes | rm -i ./* 2>&1 | sed 's/remove //g; s/\?//g' |fmt
>
> If that kind of behavior is what you want, you could make that command
> line into a shell script, replacing the ./* with "$@". This would
> allow you to use it with xargs, for example (though, for xargs, you
> might also want to remove the |fmt and pipe the result of xargs to
> fmt...).
>
> If you want something different, I guess you would have to be a bit
> clearer on what you are asking for.
>
> Thanks,
>
> --
> Raul
>
>


--
May the most significant bit of your life be positive.

Reply | Threaded
Open this post in threaded view
|

Re: remove files progress bar : solved!

Max Power
In reply to this post by Raul Miller
Thank You very much Raul!

This is precisely the way I was looking for...


> Try this, then:
>
> #  yes | rm -ir /home/games; echo
>
> This will put everything on one long line which will be a bit ugly,
> but will show progress as it happens.
>
> Thanks,
>
> --
> Raul
>
>
> On Sun, Apr 3, 2016 at 12:21 PM, Max Power <[hidden email]>
> wrote:
>> Thank You Raul for reply,
>> Your command line run so well... but it is not suitable for the purpose.
>> I want to see 'while you're erasing them' not 'after like a log'.
>>
>> Maybe It not possible.
>>
>> [it wanted only a rm -v as in Linux!]
>>
>>
>>
>>> #  yes | rm -ir /home/games 2>&1 | sed 's/remove //g; s/\?//g' |fmt
>>>
>>> (Here, # is meant to represent the prompt - it's not a part of the
>>> command.)
>>>
>>> Thanks,
>>>
>>> --
>>> Raul
>>>
>>>
>>> On Sun, Apr 3, 2016 at 3:59 AM, Max Power <[hidden email]>
>>> wrote:
>>>> Hi Raul, Thanks for Your reply.
>>>>
>>>> I tried & failed ... !!
>>>>
>>>> Could you give me, please, a practical example...?
>>>> e.g.: remove /home/games
>>>>
>>>>
>>>>> On Sun, Apr 3, 2016 at 2:57 AM, Max Power <[hidden email]>
>>>>> wrote:
>>>>>> Hi guys!
>>>>>> Is there a way to view the deleted file or a progress bar
>>>>>> while you're erasing them?
>>>>>>
>>>>>> Thanks for Your reply.
>>>>>
>>>>> Do you mean like this?
>>>>>
>>>>> yes | rm -i ./* 2>&1 | sed 's/remove //g; s/\?//g' |fmt
>>>>>
>>>>> If that kind of behavior is what you want, you could make that
>>>>> command
>>>>> line into a shell script, replacing the ./* with "$@". This would
>>>>> allow you to use it with xargs, for example (though, for xargs, you
>>>>> might also want to remove the |fmt and pipe the result of xargs to
>>>>> fmt...).
>>>>>
>>>>> If you want something different, I guess you would have to be a bit
>>>>> clearer on what you are asking for.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> --
>>>>> Raul