How to make files deleted from a mounted partion go to the “recycle bin” on CentOS 7
I'd like to know how can i set a mounted partition to send deleted files from main directory to the "recycle bin" on CentOS 7. They all are removed directly.
centos
add a comment |
I'd like to know how can i set a mounted partition to send deleted files from main directory to the "recycle bin" on CentOS 7. They all are removed directly.
centos
2
Related: unix.stackexchange.com/questions/452496/… and unix.stackexchange.com/questions/379138/…
– Jeff Schaller
Dec 17 at 19:04
add a comment |
I'd like to know how can i set a mounted partition to send deleted files from main directory to the "recycle bin" on CentOS 7. They all are removed directly.
centos
I'd like to know how can i set a mounted partition to send deleted files from main directory to the "recycle bin" on CentOS 7. They all are removed directly.
centos
centos
edited Dec 17 at 19:21
asked Dec 17 at 18:52
El_Dorado
357
357
2
Related: unix.stackexchange.com/questions/452496/… and unix.stackexchange.com/questions/379138/…
– Jeff Schaller
Dec 17 at 19:04
add a comment |
2
Related: unix.stackexchange.com/questions/452496/… and unix.stackexchange.com/questions/379138/…
– Jeff Schaller
Dec 17 at 19:04
2
2
Related: unix.stackexchange.com/questions/452496/… and unix.stackexchange.com/questions/379138/…
– Jeff Schaller
Dec 17 at 19:04
Related: unix.stackexchange.com/questions/452496/… and unix.stackexchange.com/questions/379138/…
– Jeff Schaller
Dec 17 at 19:04
add a comment |
1 Answer
1
active
oldest
votes
This depends completely on the method of deletion. If you are issuing rm -rf
on this secondary mounted partition you will never get those files back without using a file system that allows you to restore from a previous snapshot or you have backups.
You can however use trash-cli
or create an alias like described in the related answers here and here to delete things from the command line and place them in a "recycle bin". If you use a graphical file manager like Nautilus or Dolphin, things deleted from mounted partitions typically go to a "recycle bin" by default.
Install trash-cli
using yum install trash-cli
Delete a file by issuing trash-put /path/to/file
Use trash-list
to see what is in the trash currently and use trash-restore
to restore the deleted file. And to empty the trash you simply issue trash-empty
. Using trash-empty 30
clears out all files that have been in trash for 30 days or longer.
Alternatively you can add an alias to your .bashrc
that you will use instead of rm
that user Kusalananda does in this answer.
alias trash='mkdir -p "$HOME/.trash" && mv -b -t "$HOME/.trash"'
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f489544%2fhow-to-make-files-deleted-from-a-mounted-partion-go-to-the-recycle-bin-on-cent%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This depends completely on the method of deletion. If you are issuing rm -rf
on this secondary mounted partition you will never get those files back without using a file system that allows you to restore from a previous snapshot or you have backups.
You can however use trash-cli
or create an alias like described in the related answers here and here to delete things from the command line and place them in a "recycle bin". If you use a graphical file manager like Nautilus or Dolphin, things deleted from mounted partitions typically go to a "recycle bin" by default.
Install trash-cli
using yum install trash-cli
Delete a file by issuing trash-put /path/to/file
Use trash-list
to see what is in the trash currently and use trash-restore
to restore the deleted file. And to empty the trash you simply issue trash-empty
. Using trash-empty 30
clears out all files that have been in trash for 30 days or longer.
Alternatively you can add an alias to your .bashrc
that you will use instead of rm
that user Kusalananda does in this answer.
alias trash='mkdir -p "$HOME/.trash" && mv -b -t "$HOME/.trash"'
add a comment |
This depends completely on the method of deletion. If you are issuing rm -rf
on this secondary mounted partition you will never get those files back without using a file system that allows you to restore from a previous snapshot or you have backups.
You can however use trash-cli
or create an alias like described in the related answers here and here to delete things from the command line and place them in a "recycle bin". If you use a graphical file manager like Nautilus or Dolphin, things deleted from mounted partitions typically go to a "recycle bin" by default.
Install trash-cli
using yum install trash-cli
Delete a file by issuing trash-put /path/to/file
Use trash-list
to see what is in the trash currently and use trash-restore
to restore the deleted file. And to empty the trash you simply issue trash-empty
. Using trash-empty 30
clears out all files that have been in trash for 30 days or longer.
Alternatively you can add an alias to your .bashrc
that you will use instead of rm
that user Kusalananda does in this answer.
alias trash='mkdir -p "$HOME/.trash" && mv -b -t "$HOME/.trash"'
add a comment |
This depends completely on the method of deletion. If you are issuing rm -rf
on this secondary mounted partition you will never get those files back without using a file system that allows you to restore from a previous snapshot or you have backups.
You can however use trash-cli
or create an alias like described in the related answers here and here to delete things from the command line and place them in a "recycle bin". If you use a graphical file manager like Nautilus or Dolphin, things deleted from mounted partitions typically go to a "recycle bin" by default.
Install trash-cli
using yum install trash-cli
Delete a file by issuing trash-put /path/to/file
Use trash-list
to see what is in the trash currently and use trash-restore
to restore the deleted file. And to empty the trash you simply issue trash-empty
. Using trash-empty 30
clears out all files that have been in trash for 30 days or longer.
Alternatively you can add an alias to your .bashrc
that you will use instead of rm
that user Kusalananda does in this answer.
alias trash='mkdir -p "$HOME/.trash" && mv -b -t "$HOME/.trash"'
This depends completely on the method of deletion. If you are issuing rm -rf
on this secondary mounted partition you will never get those files back without using a file system that allows you to restore from a previous snapshot or you have backups.
You can however use trash-cli
or create an alias like described in the related answers here and here to delete things from the command line and place them in a "recycle bin". If you use a graphical file manager like Nautilus or Dolphin, things deleted from mounted partitions typically go to a "recycle bin" by default.
Install trash-cli
using yum install trash-cli
Delete a file by issuing trash-put /path/to/file
Use trash-list
to see what is in the trash currently and use trash-restore
to restore the deleted file. And to empty the trash you simply issue trash-empty
. Using trash-empty 30
clears out all files that have been in trash for 30 days or longer.
Alternatively you can add an alias to your .bashrc
that you will use instead of rm
that user Kusalananda does in this answer.
alias trash='mkdir -p "$HOME/.trash" && mv -b -t "$HOME/.trash"'
edited Dec 17 at 19:12
answered Dec 17 at 19:06
kemotep
2,0213620
2,0213620
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f489544%2fhow-to-make-files-deleted-from-a-mounted-partion-go-to-the-recycle-bin-on-cent%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Related: unix.stackexchange.com/questions/452496/… and unix.stackexchange.com/questions/379138/…
– Jeff Schaller
Dec 17 at 19:04