Skip to main content
Quote to handle names with spaces and globbing symbols, use double dash to handle nams starting with dash (would otherwise be mistaken for options)
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

This is not applicable to most cases, but a trivial and instant way of fast deletion is renaming the directory and deleting in the background.

frm () {
    now=$(date "+%F-%T-%Z")
    for file in "$@"
    do
        new_name="${file}_${now}"
        mv -i $file-- $new_name"$file" "$new_name"
        nohup rm -rf $new_name-- "$new_name" > "/tmp/$new_name.loglog" 2>&1 &
    done
}

In my case, I often need to recreate node_modules or a repository entirely, and deleting would take forever. I just rename node_modules to deleting_node_modules and run the rm command in the background.

I get to continue with my work right away.

This is not applicable to most cases, but a trivial and instant way of fast deletion is renaming the directory and deleting in the background.

frm () {
    now=$(date "+%F-%T-%Z")
    for file in "$@"
    do
        new_name="${file}_${now}"
        mv -i $file $new_name
        nohup rm -rf $new_name > /tmp/$new_name.log 2>&1 &
    done
}

In my case, I often need to recreate node_modules or a repository entirely, and deleting would take forever. I just rename node_modules to deleting_node_modules and run the rm command in the background.

I get to continue with my work right away.

This is not applicable to most cases, but a trivial and instant way of fast deletion is renaming the directory and deleting in the background.

frm () {
    now=$(date "+%F-%T-%Z")
    for file in "$@"
    do
        new_name="${file}_${now}"
        mv -i -- "$file" "$new_name"
        nohup rm -rf -- "$new_name" > "/tmp/$new_name.log" 2>&1 &
    done
}

In my case, I often need to recreate node_modules or a repository entirely, and deleting would take forever. I just rename node_modules to deleting_node_modules and run the rm command in the background.

I get to continue with my work right away.

added 218 characters in body
Source Link

This is not applicable to most cases, but a trivial and instant way of fast deletion is renaming the directory and deleting in the background.

frm () {
    now=$(date "+%F-%T-%Z")
    for file in "$@"
    do
        new_name="${file}_${now}"
        mv -i $file $new_name
        nohup rm -rf $new_name > /tmp/$new_name.log 2>&1 &
    done
}

In my case, I often need to recreate node_modules or a repository entirely, and deleting would take forever. I just rename node_modules to deleting_node_modules and run the rm command in the background.

I get to continue with my work right away.

This is not applicable to most cases, but a trivial and instant way of fast deletion is renaming the directory and deleting in the background.

In my case, I often need to recreate node_modules or a repository entirely, and deleting would take forever. I just rename node_modules to deleting_node_modules and run the rm command in the background.

I get to continue with my work right away.

This is not applicable to most cases, but a trivial and instant way of fast deletion is renaming the directory and deleting in the background.

frm () {
    now=$(date "+%F-%T-%Z")
    for file in "$@"
    do
        new_name="${file}_${now}"
        mv -i $file $new_name
        nohup rm -rf $new_name > /tmp/$new_name.log 2>&1 &
    done
}

In my case, I often need to recreate node_modules or a repository entirely, and deleting would take forever. I just rename node_modules to deleting_node_modules and run the rm command in the background.

I get to continue with my work right away.

Source Link

This is not applicable to most cases, but a trivial and instant way of fast deletion is renaming the directory and deleting in the background.

In my case, I often need to recreate node_modules or a repository entirely, and deleting would take forever. I just rename node_modules to deleting_node_modules and run the rm command in the background.

I get to continue with my work right away.