Deleted files from linux using find and need to fix

Clash Royale CLAN TAG#URR8PPP
up vote
-3
down vote
favorite
I was trying to remove this trojan that copied itself across my system and after successfully seeing all instances of the trojan using find / -name trojan I then did find / -delete -name trojan and immediately starting seeing "Operation not permitted" on files that were not related to the trojan so I killed the command with Ctrl-C but now I am having some problems.
From what I can tell, my important files are still there, and I haven't been able to figure out what it deleted, however I cannot open a new terminal window, I get a message saying '/bin/bash' No such file or directory, however if I open the file explorer it shows that bash is in /bin as well as all the other bin files. Additionally I still have a terminal open, but the only commands that work are the builtin ones (cd, echo, etc) If I try to do even ls, I get that /bin/ls cannot be found. Similarly if I type any command that is not builtin I get the same message but it tells me exactly where the file is (I can see it in explorer) bu then says no such file or directory.
How can I recover from this? Is there a way to find out what my system is missing?
ubuntu files find data-recovery
 |Â
show 7 more comments
up vote
-3
down vote
favorite
I was trying to remove this trojan that copied itself across my system and after successfully seeing all instances of the trojan using find / -name trojan I then did find / -delete -name trojan and immediately starting seeing "Operation not permitted" on files that were not related to the trojan so I killed the command with Ctrl-C but now I am having some problems.
From what I can tell, my important files are still there, and I haven't been able to figure out what it deleted, however I cannot open a new terminal window, I get a message saying '/bin/bash' No such file or directory, however if I open the file explorer it shows that bash is in /bin as well as all the other bin files. Additionally I still have a terminal open, but the only commands that work are the builtin ones (cd, echo, etc) If I try to do even ls, I get that /bin/ls cannot be found. Similarly if I type any command that is not builtin I get the same message but it tells me exactly where the file is (I can see it in explorer) bu then says no such file or directory.
How can I recover from this? Is there a way to find out what my system is missing?
ubuntu files find data-recovery
5
You deleted essential files, there is no incantation that will bring them back. Backup what you need if it is still there and reinstall the system.
â Rui F Ribeiro
Jan 24 at 0:03
@RuiFRibeiro you don't think I could boot from a live usb and install essential files, any command that was running is still running so I know commands work, they just aren't linked properly now. Anything that I have thought to check is still there.
â fjames003
Jan 24 at 0:13
2
You're not supposed to put-deletein front of-name.
â Chai T. Rex
Jan 24 at 0:14
1
@fjames003 too much work trying to recover the system, either restore it from backups or reinstall. No use crying over spilt milk.
â Rui F Ribeiro
Jan 24 at 0:29
3
yes. find does things in the order they appear on the command line. by default, predicates are ANDed (-a) with previous predicates, but you can use-oto override that and OR them. You can also use parentheses (escaped in sh( ... )) to control order of evaluation.find's command line is a fairly complex language and takes some getting used to. e.g.find / -delete -name trojanmeans "find everything under /, then delete all matches, then search for files with name trojan".find / -name trojan -deletemeans "find everything under / with name trojan and delete them".
â cas
Jan 24 at 1:14
 |Â
show 7 more comments
up vote
-3
down vote
favorite
up vote
-3
down vote
favorite
I was trying to remove this trojan that copied itself across my system and after successfully seeing all instances of the trojan using find / -name trojan I then did find / -delete -name trojan and immediately starting seeing "Operation not permitted" on files that were not related to the trojan so I killed the command with Ctrl-C but now I am having some problems.
From what I can tell, my important files are still there, and I haven't been able to figure out what it deleted, however I cannot open a new terminal window, I get a message saying '/bin/bash' No such file or directory, however if I open the file explorer it shows that bash is in /bin as well as all the other bin files. Additionally I still have a terminal open, but the only commands that work are the builtin ones (cd, echo, etc) If I try to do even ls, I get that /bin/ls cannot be found. Similarly if I type any command that is not builtin I get the same message but it tells me exactly where the file is (I can see it in explorer) bu then says no such file or directory.
How can I recover from this? Is there a way to find out what my system is missing?
ubuntu files find data-recovery
I was trying to remove this trojan that copied itself across my system and after successfully seeing all instances of the trojan using find / -name trojan I then did find / -delete -name trojan and immediately starting seeing "Operation not permitted" on files that were not related to the trojan so I killed the command with Ctrl-C but now I am having some problems.
From what I can tell, my important files are still there, and I haven't been able to figure out what it deleted, however I cannot open a new terminal window, I get a message saying '/bin/bash' No such file or directory, however if I open the file explorer it shows that bash is in /bin as well as all the other bin files. Additionally I still have a terminal open, but the only commands that work are the builtin ones (cd, echo, etc) If I try to do even ls, I get that /bin/ls cannot be found. Similarly if I type any command that is not builtin I get the same message but it tells me exactly where the file is (I can see it in explorer) bu then says no such file or directory.
How can I recover from this? Is there a way to find out what my system is missing?
ubuntu files find data-recovery
edited Jan 24 at 0:42
Jeff Schaller
31.7k847107
31.7k847107
asked Jan 23 at 23:57
fjames003
132
132
5
You deleted essential files, there is no incantation that will bring them back. Backup what you need if it is still there and reinstall the system.
â Rui F Ribeiro
Jan 24 at 0:03
@RuiFRibeiro you don't think I could boot from a live usb and install essential files, any command that was running is still running so I know commands work, they just aren't linked properly now. Anything that I have thought to check is still there.
â fjames003
Jan 24 at 0:13
2
You're not supposed to put-deletein front of-name.
â Chai T. Rex
Jan 24 at 0:14
1
@fjames003 too much work trying to recover the system, either restore it from backups or reinstall. No use crying over spilt milk.
â Rui F Ribeiro
Jan 24 at 0:29
3
yes. find does things in the order they appear on the command line. by default, predicates are ANDed (-a) with previous predicates, but you can use-oto override that and OR them. You can also use parentheses (escaped in sh( ... )) to control order of evaluation.find's command line is a fairly complex language and takes some getting used to. e.g.find / -delete -name trojanmeans "find everything under /, then delete all matches, then search for files with name trojan".find / -name trojan -deletemeans "find everything under / with name trojan and delete them".
â cas
Jan 24 at 1:14
 |Â
show 7 more comments
5
You deleted essential files, there is no incantation that will bring them back. Backup what you need if it is still there and reinstall the system.
â Rui F Ribeiro
Jan 24 at 0:03
@RuiFRibeiro you don't think I could boot from a live usb and install essential files, any command that was running is still running so I know commands work, they just aren't linked properly now. Anything that I have thought to check is still there.
â fjames003
Jan 24 at 0:13
2
You're not supposed to put-deletein front of-name.
â Chai T. Rex
Jan 24 at 0:14
1
@fjames003 too much work trying to recover the system, either restore it from backups or reinstall. No use crying over spilt milk.
â Rui F Ribeiro
Jan 24 at 0:29
3
yes. find does things in the order they appear on the command line. by default, predicates are ANDed (-a) with previous predicates, but you can use-oto override that and OR them. You can also use parentheses (escaped in sh( ... )) to control order of evaluation.find's command line is a fairly complex language and takes some getting used to. e.g.find / -delete -name trojanmeans "find everything under /, then delete all matches, then search for files with name trojan".find / -name trojan -deletemeans "find everything under / with name trojan and delete them".
â cas
Jan 24 at 1:14
5
5
You deleted essential files, there is no incantation that will bring them back. Backup what you need if it is still there and reinstall the system.
â Rui F Ribeiro
Jan 24 at 0:03
You deleted essential files, there is no incantation that will bring them back. Backup what you need if it is still there and reinstall the system.
â Rui F Ribeiro
Jan 24 at 0:03
@RuiFRibeiro you don't think I could boot from a live usb and install essential files, any command that was running is still running so I know commands work, they just aren't linked properly now. Anything that I have thought to check is still there.
â fjames003
Jan 24 at 0:13
@RuiFRibeiro you don't think I could boot from a live usb and install essential files, any command that was running is still running so I know commands work, they just aren't linked properly now. Anything that I have thought to check is still there.
â fjames003
Jan 24 at 0:13
2
2
You're not supposed to put
-delete in front of -name.â Chai T. Rex
Jan 24 at 0:14
You're not supposed to put
-delete in front of -name.â Chai T. Rex
Jan 24 at 0:14
1
1
@fjames003 too much work trying to recover the system, either restore it from backups or reinstall. No use crying over spilt milk.
â Rui F Ribeiro
Jan 24 at 0:29
@fjames003 too much work trying to recover the system, either restore it from backups or reinstall. No use crying over spilt milk.
â Rui F Ribeiro
Jan 24 at 0:29
3
3
yes. find does things in the order they appear on the command line. by default, predicates are ANDed (
-a) with previous predicates, but you can use -o to override that and OR them. You can also use parentheses (escaped in sh ( ... )) to control order of evaluation. find's command line is a fairly complex language and takes some getting used to. e.g. find / -delete -name trojan means "find everything under /, then delete all matches, then search for files with name trojan". find / -name trojan -delete means "find everything under / with name trojan and delete them".â cas
Jan 24 at 1:14
yes. find does things in the order they appear on the command line. by default, predicates are ANDed (
-a) with previous predicates, but you can use -o to override that and OR them. You can also use parentheses (escaped in sh ( ... )) to control order of evaluation. find's command line is a fairly complex language and takes some getting used to. e.g. find / -delete -name trojan means "find everything under /, then delete all matches, then search for files with name trojan". find / -name trojan -delete means "find everything under / with name trojan and delete them".â cas
Jan 24 at 1:14
 |Â
show 7 more comments
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
find / -delete -name trojan
attempted to delete all files on the root filesystem. The command you meant to use is
find / -name trojan -delete
Sorry to be the bearer of bad news but your system is FUBAR. You should boot up from a live CD, copy on an external drive any important personal file might have been left on the system, then do a fresh reinstall.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
find / -delete -name trojan
attempted to delete all files on the root filesystem. The command you meant to use is
find / -name trojan -delete
Sorry to be the bearer of bad news but your system is FUBAR. You should boot up from a live CD, copy on an external drive any important personal file might have been left on the system, then do a fresh reinstall.
add a comment |Â
up vote
2
down vote
accepted
find / -delete -name trojan
attempted to delete all files on the root filesystem. The command you meant to use is
find / -name trojan -delete
Sorry to be the bearer of bad news but your system is FUBAR. You should boot up from a live CD, copy on an external drive any important personal file might have been left on the system, then do a fresh reinstall.
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
find / -delete -name trojan
attempted to delete all files on the root filesystem. The command you meant to use is
find / -name trojan -delete
Sorry to be the bearer of bad news but your system is FUBAR. You should boot up from a live CD, copy on an external drive any important personal file might have been left on the system, then do a fresh reinstall.
find / -delete -name trojan
attempted to delete all files on the root filesystem. The command you meant to use is
find / -name trojan -delete
Sorry to be the bearer of bad news but your system is FUBAR. You should boot up from a live CD, copy on an external drive any important personal file might have been left on the system, then do a fresh reinstall.
answered Jan 24 at 8:23
dr01
15.1k114768
15.1k114768
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f419226%2fdeleted-files-from-linux-using-find-and-need-to-fix%23new-answer', 'question_page');
);
Post as a guest
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
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
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
5
You deleted essential files, there is no incantation that will bring them back. Backup what you need if it is still there and reinstall the system.
â Rui F Ribeiro
Jan 24 at 0:03
@RuiFRibeiro you don't think I could boot from a live usb and install essential files, any command that was running is still running so I know commands work, they just aren't linked properly now. Anything that I have thought to check is still there.
â fjames003
Jan 24 at 0:13
2
You're not supposed to put
-deletein front of-name.â Chai T. Rex
Jan 24 at 0:14
1
@fjames003 too much work trying to recover the system, either restore it from backups or reinstall. No use crying over spilt milk.
â Rui F Ribeiro
Jan 24 at 0:29
3
yes. find does things in the order they appear on the command line. by default, predicates are ANDed (
-a) with previous predicates, but you can use-oto override that and OR them. You can also use parentheses (escaped in sh( ... )) to control order of evaluation.find's command line is a fairly complex language and takes some getting used to. e.g.find / -delete -name trojanmeans "find everything under /, then delete all matches, then search for files with name trojan".find / -name trojan -deletemeans "find everything under / with name trojan and delete them".â cas
Jan 24 at 1:14