Did I Mess Up My Computer with Recursive rm of '*.h"
Clash Royale CLAN TAG#URR8PPP
So I was basically trying to print all files with a .h file extention out of curiosity, and so I simply googled how to do that. Unfortunatley, I didn't pay close enough attention to the answer and just copy and pasted it, changing the file to "*.h". So, let's say I ran this for about 5 seconds before I realized what happened - is it likely a deleted anything important/unrecoverable?
Original I copied:
find . -name "*-e" -exec rm '' ;
My modified version:
find . -name "*.h" -exec rm '' ;
I also ran it from the / directory.
scripting find header-file
add a comment |
So I was basically trying to print all files with a .h file extention out of curiosity, and so I simply googled how to do that. Unfortunatley, I didn't pay close enough attention to the answer and just copy and pasted it, changing the file to "*.h". So, let's say I ran this for about 5 seconds before I realized what happened - is it likely a deleted anything important/unrecoverable?
Original I copied:
find . -name "*-e" -exec rm '' ;
My modified version:
find . -name "*.h" -exec rm '' ;
I also ran it from the / directory.
scripting find header-file
If you have, you might want to look at this question: unix.stackexchange.com/questions/304120/…
– Philip Couling
Feb 5 at 15:56
1
For future reference: Using-ok
instead of-exec
will ask you for confirmation before running the given utility (rm
in this case).
– Kusalananda
Feb 5 at 16:36
add a comment |
So I was basically trying to print all files with a .h file extention out of curiosity, and so I simply googled how to do that. Unfortunatley, I didn't pay close enough attention to the answer and just copy and pasted it, changing the file to "*.h". So, let's say I ran this for about 5 seconds before I realized what happened - is it likely a deleted anything important/unrecoverable?
Original I copied:
find . -name "*-e" -exec rm '' ;
My modified version:
find . -name "*.h" -exec rm '' ;
I also ran it from the / directory.
scripting find header-file
So I was basically trying to print all files with a .h file extention out of curiosity, and so I simply googled how to do that. Unfortunatley, I didn't pay close enough attention to the answer and just copy and pasted it, changing the file to "*.h". So, let's say I ran this for about 5 seconds before I realized what happened - is it likely a deleted anything important/unrecoverable?
Original I copied:
find . -name "*-e" -exec rm '' ;
My modified version:
find . -name "*.h" -exec rm '' ;
I also ran it from the / directory.
scripting find header-file
scripting find header-file
edited Feb 5 at 16:23
ctrl-alt-delor
11.7k42159
11.7k42159
asked Feb 5 at 15:09
John-John-
1
1
If you have, you might want to look at this question: unix.stackexchange.com/questions/304120/…
– Philip Couling
Feb 5 at 15:56
1
For future reference: Using-ok
instead of-exec
will ask you for confirmation before running the given utility (rm
in this case).
– Kusalananda
Feb 5 at 16:36
add a comment |
If you have, you might want to look at this question: unix.stackexchange.com/questions/304120/…
– Philip Couling
Feb 5 at 15:56
1
For future reference: Using-ok
instead of-exec
will ask you for confirmation before running the given utility (rm
in this case).
– Kusalananda
Feb 5 at 16:36
If you have, you might want to look at this question: unix.stackexchange.com/questions/304120/…
– Philip Couling
Feb 5 at 15:56
If you have, you might want to look at this question: unix.stackexchange.com/questions/304120/…
– Philip Couling
Feb 5 at 15:56
1
1
For future reference: Using
-ok
instead of -exec
will ask you for confirmation before running the given utility (rm
in this case).– Kusalananda
Feb 5 at 16:36
For future reference: Using
-ok
instead of -exec
will ask you for confirmation before running the given utility (rm
in this case).– Kusalananda
Feb 5 at 16:36
add a comment |
1 Answer
1
active
oldest
votes
If you ran that command from the root directory, you (started to) remove all header files that you own from your entire filesystem. If you were silly enough to have done this as the root user, than you'll have done it system-wide to all users rather than just affecting files you own.
This won't inherently break the system itself, but will make it impossible to compile anything that relied on those header libraries. I would suggest restoring these files from the backups you assuredly have to hedge against this sort of situation or, of those are not available, you can have your package manager list installed packages, scour that list for any packages including source code, and have the package manager reinstall those packages.
He didn't just remove header files. Any file that is at least two characters long and ends in 'h' has potentially been removed. Hopefully he still has shells available for use.
– Doug O'Neal
Feb 5 at 17:24
No, any file that is at least two characters long and ends in.h
. He used-name
, not-regex
..
is not a wildcard.
– DopeGhoti
Feb 5 at 18:32
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%2f498820%2fdid-i-mess-up-my-computer-with-recursive-rm-of-h%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
If you ran that command from the root directory, you (started to) remove all header files that you own from your entire filesystem. If you were silly enough to have done this as the root user, than you'll have done it system-wide to all users rather than just affecting files you own.
This won't inherently break the system itself, but will make it impossible to compile anything that relied on those header libraries. I would suggest restoring these files from the backups you assuredly have to hedge against this sort of situation or, of those are not available, you can have your package manager list installed packages, scour that list for any packages including source code, and have the package manager reinstall those packages.
He didn't just remove header files. Any file that is at least two characters long and ends in 'h' has potentially been removed. Hopefully he still has shells available for use.
– Doug O'Neal
Feb 5 at 17:24
No, any file that is at least two characters long and ends in.h
. He used-name
, not-regex
..
is not a wildcard.
– DopeGhoti
Feb 5 at 18:32
add a comment |
If you ran that command from the root directory, you (started to) remove all header files that you own from your entire filesystem. If you were silly enough to have done this as the root user, than you'll have done it system-wide to all users rather than just affecting files you own.
This won't inherently break the system itself, but will make it impossible to compile anything that relied on those header libraries. I would suggest restoring these files from the backups you assuredly have to hedge against this sort of situation or, of those are not available, you can have your package manager list installed packages, scour that list for any packages including source code, and have the package manager reinstall those packages.
He didn't just remove header files. Any file that is at least two characters long and ends in 'h' has potentially been removed. Hopefully he still has shells available for use.
– Doug O'Neal
Feb 5 at 17:24
No, any file that is at least two characters long and ends in.h
. He used-name
, not-regex
..
is not a wildcard.
– DopeGhoti
Feb 5 at 18:32
add a comment |
If you ran that command from the root directory, you (started to) remove all header files that you own from your entire filesystem. If you were silly enough to have done this as the root user, than you'll have done it system-wide to all users rather than just affecting files you own.
This won't inherently break the system itself, but will make it impossible to compile anything that relied on those header libraries. I would suggest restoring these files from the backups you assuredly have to hedge against this sort of situation or, of those are not available, you can have your package manager list installed packages, scour that list for any packages including source code, and have the package manager reinstall those packages.
If you ran that command from the root directory, you (started to) remove all header files that you own from your entire filesystem. If you were silly enough to have done this as the root user, than you'll have done it system-wide to all users rather than just affecting files you own.
This won't inherently break the system itself, but will make it impossible to compile anything that relied on those header libraries. I would suggest restoring these files from the backups you assuredly have to hedge against this sort of situation or, of those are not available, you can have your package manager list installed packages, scour that list for any packages including source code, and have the package manager reinstall those packages.
answered Feb 5 at 15:19
DopeGhotiDopeGhoti
45.8k55988
45.8k55988
He didn't just remove header files. Any file that is at least two characters long and ends in 'h' has potentially been removed. Hopefully he still has shells available for use.
– Doug O'Neal
Feb 5 at 17:24
No, any file that is at least two characters long and ends in.h
. He used-name
, not-regex
..
is not a wildcard.
– DopeGhoti
Feb 5 at 18:32
add a comment |
He didn't just remove header files. Any file that is at least two characters long and ends in 'h' has potentially been removed. Hopefully he still has shells available for use.
– Doug O'Neal
Feb 5 at 17:24
No, any file that is at least two characters long and ends in.h
. He used-name
, not-regex
..
is not a wildcard.
– DopeGhoti
Feb 5 at 18:32
He didn't just remove header files. Any file that is at least two characters long and ends in 'h' has potentially been removed. Hopefully he still has shells available for use.
– Doug O'Neal
Feb 5 at 17:24
He didn't just remove header files. Any file that is at least two characters long and ends in 'h' has potentially been removed. Hopefully he still has shells available for use.
– Doug O'Neal
Feb 5 at 17:24
No, any file that is at least two characters long and ends in
.h
. He used -name
, not -regex
. .
is not a wildcard.– DopeGhoti
Feb 5 at 18:32
No, any file that is at least two characters long and ends in
.h
. He used -name
, not -regex
. .
is not a wildcard.– DopeGhoti
Feb 5 at 18:32
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.
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%2f498820%2fdid-i-mess-up-my-computer-with-recursive-rm-of-h%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
If you have, you might want to look at this question: unix.stackexchange.com/questions/304120/…
– Philip Couling
Feb 5 at 15:56
1
For future reference: Using
-ok
instead of-exec
will ask you for confirmation before running the given utility (rm
in this case).– Kusalananda
Feb 5 at 16:36