Ran wrong script, moved folders are gone, but where? [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
-1
down vote

favorite












I accidentally ran wrong bash script, while trying to move files. All the folders starting like "Lisa" gone and not moved. Below are the rough content of the wrong script.



folder_path = "/media/hdd/folder/"
Lisa = "/media/hdd/folder/folder1/Lisa/"

mv $folder_path Lisa* $Lisa


All the folders starts with Lisa are gone, I checked /media/hdd/folder/folder1/Lisa/ but they are not there. I assume they are deleted but df -h still reports the same free space before I ran the wrong script.



I couldn't find anything using lsof.
Are the folders deleted or something else?
Any help will be truly appreciated.







share|improve this question














closed as unclear what you're asking by jasonwryan, Stephen Rauch, G-Man, countermode, Romeo Ninov Dec 7 '17 at 10:16


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 4




    Post the exact commands run, not an approximation.
    – jasonwryan
    Dec 6 '17 at 16:57










  • Have you tried running find?
    – G-Man
    Dec 7 '17 at 0:42














up vote
-1
down vote

favorite












I accidentally ran wrong bash script, while trying to move files. All the folders starting like "Lisa" gone and not moved. Below are the rough content of the wrong script.



folder_path = "/media/hdd/folder/"
Lisa = "/media/hdd/folder/folder1/Lisa/"

mv $folder_path Lisa* $Lisa


All the folders starts with Lisa are gone, I checked /media/hdd/folder/folder1/Lisa/ but they are not there. I assume they are deleted but df -h still reports the same free space before I ran the wrong script.



I couldn't find anything using lsof.
Are the folders deleted or something else?
Any help will be truly appreciated.







share|improve this question














closed as unclear what you're asking by jasonwryan, Stephen Rauch, G-Man, countermode, Romeo Ninov Dec 7 '17 at 10:16


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 4




    Post the exact commands run, not an approximation.
    – jasonwryan
    Dec 6 '17 at 16:57










  • Have you tried running find?
    – G-Man
    Dec 7 '17 at 0:42












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I accidentally ran wrong bash script, while trying to move files. All the folders starting like "Lisa" gone and not moved. Below are the rough content of the wrong script.



folder_path = "/media/hdd/folder/"
Lisa = "/media/hdd/folder/folder1/Lisa/"

mv $folder_path Lisa* $Lisa


All the folders starts with Lisa are gone, I checked /media/hdd/folder/folder1/Lisa/ but they are not there. I assume they are deleted but df -h still reports the same free space before I ran the wrong script.



I couldn't find anything using lsof.
Are the folders deleted or something else?
Any help will be truly appreciated.







share|improve this question














I accidentally ran wrong bash script, while trying to move files. All the folders starting like "Lisa" gone and not moved. Below are the rough content of the wrong script.



folder_path = "/media/hdd/folder/"
Lisa = "/media/hdd/folder/folder1/Lisa/"

mv $folder_path Lisa* $Lisa


All the folders starts with Lisa are gone, I checked /media/hdd/folder/folder1/Lisa/ but they are not there. I assume they are deleted but df -h still reports the same free space before I ran the wrong script.



I couldn't find anything using lsof.
Are the folders deleted or something else?
Any help will be truly appreciated.









share|improve this question













share|improve this question




share|improve this question








edited Dec 6 '17 at 16:27









Patrick Mevzek

2,0381721




2,0381721










asked Dec 6 '17 at 16:06









user611811

62




62




closed as unclear what you're asking by jasonwryan, Stephen Rauch, G-Man, countermode, Romeo Ninov Dec 7 '17 at 10:16


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as unclear what you're asking by jasonwryan, Stephen Rauch, G-Man, countermode, Romeo Ninov Dec 7 '17 at 10:16


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









  • 4




    Post the exact commands run, not an approximation.
    – jasonwryan
    Dec 6 '17 at 16:57










  • Have you tried running find?
    – G-Man
    Dec 7 '17 at 0:42












  • 4




    Post the exact commands run, not an approximation.
    – jasonwryan
    Dec 6 '17 at 16:57










  • Have you tried running find?
    – G-Man
    Dec 7 '17 at 0:42







4




4




Post the exact commands run, not an approximation.
– jasonwryan
Dec 6 '17 at 16:57




Post the exact commands run, not an approximation.
– jasonwryan
Dec 6 '17 at 16:57












Have you tried running find?
– G-Man
Dec 7 '17 at 0:42




Have you tried running find?
– G-Man
Dec 7 '17 at 0:42










1 Answer
1






active

oldest

votes

















up vote
1
down vote













You have a few issues with your syntax that would cause some problems. In bash (though I'm not sure if that's how you ran this script), the = operator does not perform assignment if there are spaces around it. That is, x=y assigns y to x, but x = y compares x and y. Since you have spaces, I'll assume that both folder_path and Lisa are unset (since no assignment was performed).



If that's the case, on the mv line, $folder_path and $Lisa expanded to an empty string. So, you basically ran this:



mv Lisa*


This expands to everything starting with "Lisa" in your current working directory. Depending on what you have in there, this could do a few different things, including overwriting, moving, and renaming these files.






share|improve this answer




















  • I know, thank you for your explanation. This was supposed to be python script but I accidentally ran as bash script. I want to know, if folders are gone or copied somewhere else, I couldn't figure it out because I have the same exact disk space before I ran the script and /media/hdd/folder/folder1/Lisa/ folder is empty.
    – user611811
    Dec 6 '17 at 17:30










  • In the future, put a #!/usr/bin/env python at the top of your script to make sure your shell will run it as such. As for finding the files, we can't really help you. You could run find . -name "*Lisa*" to find any files/directories containing the string "Lisa" recursively in your current directory.
    – John Moon
    Dec 6 '17 at 17:35










  • OK I found them. Let me explain, if I can... find . -iname Lisa* returns nothing. Command ls -larth shows nothing about Lisa, so as ls, but if I type cd Lisa. and hit Tab key cd enters Lisa.z..... folder and everything is there. I don't know why ls and ls -larth doesn't show this Lisa.z... folder I am really curious.
    – user611811
    Dec 6 '17 at 17:42











  • Both find and ls are able to find a folder named "Lisa.z" on my machine without special options. I'm not sure what's wrong with your setup.
    – John Moon
    Dec 6 '17 at 18:41

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













You have a few issues with your syntax that would cause some problems. In bash (though I'm not sure if that's how you ran this script), the = operator does not perform assignment if there are spaces around it. That is, x=y assigns y to x, but x = y compares x and y. Since you have spaces, I'll assume that both folder_path and Lisa are unset (since no assignment was performed).



If that's the case, on the mv line, $folder_path and $Lisa expanded to an empty string. So, you basically ran this:



mv Lisa*


This expands to everything starting with "Lisa" in your current working directory. Depending on what you have in there, this could do a few different things, including overwriting, moving, and renaming these files.






share|improve this answer




















  • I know, thank you for your explanation. This was supposed to be python script but I accidentally ran as bash script. I want to know, if folders are gone or copied somewhere else, I couldn't figure it out because I have the same exact disk space before I ran the script and /media/hdd/folder/folder1/Lisa/ folder is empty.
    – user611811
    Dec 6 '17 at 17:30










  • In the future, put a #!/usr/bin/env python at the top of your script to make sure your shell will run it as such. As for finding the files, we can't really help you. You could run find . -name "*Lisa*" to find any files/directories containing the string "Lisa" recursively in your current directory.
    – John Moon
    Dec 6 '17 at 17:35










  • OK I found them. Let me explain, if I can... find . -iname Lisa* returns nothing. Command ls -larth shows nothing about Lisa, so as ls, but if I type cd Lisa. and hit Tab key cd enters Lisa.z..... folder and everything is there. I don't know why ls and ls -larth doesn't show this Lisa.z... folder I am really curious.
    – user611811
    Dec 6 '17 at 17:42











  • Both find and ls are able to find a folder named "Lisa.z" on my machine without special options. I'm not sure what's wrong with your setup.
    – John Moon
    Dec 6 '17 at 18:41














up vote
1
down vote













You have a few issues with your syntax that would cause some problems. In bash (though I'm not sure if that's how you ran this script), the = operator does not perform assignment if there are spaces around it. That is, x=y assigns y to x, but x = y compares x and y. Since you have spaces, I'll assume that both folder_path and Lisa are unset (since no assignment was performed).



If that's the case, on the mv line, $folder_path and $Lisa expanded to an empty string. So, you basically ran this:



mv Lisa*


This expands to everything starting with "Lisa" in your current working directory. Depending on what you have in there, this could do a few different things, including overwriting, moving, and renaming these files.






share|improve this answer




















  • I know, thank you for your explanation. This was supposed to be python script but I accidentally ran as bash script. I want to know, if folders are gone or copied somewhere else, I couldn't figure it out because I have the same exact disk space before I ran the script and /media/hdd/folder/folder1/Lisa/ folder is empty.
    – user611811
    Dec 6 '17 at 17:30










  • In the future, put a #!/usr/bin/env python at the top of your script to make sure your shell will run it as such. As for finding the files, we can't really help you. You could run find . -name "*Lisa*" to find any files/directories containing the string "Lisa" recursively in your current directory.
    – John Moon
    Dec 6 '17 at 17:35










  • OK I found them. Let me explain, if I can... find . -iname Lisa* returns nothing. Command ls -larth shows nothing about Lisa, so as ls, but if I type cd Lisa. and hit Tab key cd enters Lisa.z..... folder and everything is there. I don't know why ls and ls -larth doesn't show this Lisa.z... folder I am really curious.
    – user611811
    Dec 6 '17 at 17:42











  • Both find and ls are able to find a folder named "Lisa.z" on my machine without special options. I'm not sure what's wrong with your setup.
    – John Moon
    Dec 6 '17 at 18:41












up vote
1
down vote










up vote
1
down vote









You have a few issues with your syntax that would cause some problems. In bash (though I'm not sure if that's how you ran this script), the = operator does not perform assignment if there are spaces around it. That is, x=y assigns y to x, but x = y compares x and y. Since you have spaces, I'll assume that both folder_path and Lisa are unset (since no assignment was performed).



If that's the case, on the mv line, $folder_path and $Lisa expanded to an empty string. So, you basically ran this:



mv Lisa*


This expands to everything starting with "Lisa" in your current working directory. Depending on what you have in there, this could do a few different things, including overwriting, moving, and renaming these files.






share|improve this answer












You have a few issues with your syntax that would cause some problems. In bash (though I'm not sure if that's how you ran this script), the = operator does not perform assignment if there are spaces around it. That is, x=y assigns y to x, but x = y compares x and y. Since you have spaces, I'll assume that both folder_path and Lisa are unset (since no assignment was performed).



If that's the case, on the mv line, $folder_path and $Lisa expanded to an empty string. So, you basically ran this:



mv Lisa*


This expands to everything starting with "Lisa" in your current working directory. Depending on what you have in there, this could do a few different things, including overwriting, moving, and renaming these files.







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 6 '17 at 16:44









John Moon

49026




49026











  • I know, thank you for your explanation. This was supposed to be python script but I accidentally ran as bash script. I want to know, if folders are gone or copied somewhere else, I couldn't figure it out because I have the same exact disk space before I ran the script and /media/hdd/folder/folder1/Lisa/ folder is empty.
    – user611811
    Dec 6 '17 at 17:30










  • In the future, put a #!/usr/bin/env python at the top of your script to make sure your shell will run it as such. As for finding the files, we can't really help you. You could run find . -name "*Lisa*" to find any files/directories containing the string "Lisa" recursively in your current directory.
    – John Moon
    Dec 6 '17 at 17:35










  • OK I found them. Let me explain, if I can... find . -iname Lisa* returns nothing. Command ls -larth shows nothing about Lisa, so as ls, but if I type cd Lisa. and hit Tab key cd enters Lisa.z..... folder and everything is there. I don't know why ls and ls -larth doesn't show this Lisa.z... folder I am really curious.
    – user611811
    Dec 6 '17 at 17:42











  • Both find and ls are able to find a folder named "Lisa.z" on my machine without special options. I'm not sure what's wrong with your setup.
    – John Moon
    Dec 6 '17 at 18:41
















  • I know, thank you for your explanation. This was supposed to be python script but I accidentally ran as bash script. I want to know, if folders are gone or copied somewhere else, I couldn't figure it out because I have the same exact disk space before I ran the script and /media/hdd/folder/folder1/Lisa/ folder is empty.
    – user611811
    Dec 6 '17 at 17:30










  • In the future, put a #!/usr/bin/env python at the top of your script to make sure your shell will run it as such. As for finding the files, we can't really help you. You could run find . -name "*Lisa*" to find any files/directories containing the string "Lisa" recursively in your current directory.
    – John Moon
    Dec 6 '17 at 17:35










  • OK I found them. Let me explain, if I can... find . -iname Lisa* returns nothing. Command ls -larth shows nothing about Lisa, so as ls, but if I type cd Lisa. and hit Tab key cd enters Lisa.z..... folder and everything is there. I don't know why ls and ls -larth doesn't show this Lisa.z... folder I am really curious.
    – user611811
    Dec 6 '17 at 17:42











  • Both find and ls are able to find a folder named "Lisa.z" on my machine without special options. I'm not sure what's wrong with your setup.
    – John Moon
    Dec 6 '17 at 18:41















I know, thank you for your explanation. This was supposed to be python script but I accidentally ran as bash script. I want to know, if folders are gone or copied somewhere else, I couldn't figure it out because I have the same exact disk space before I ran the script and /media/hdd/folder/folder1/Lisa/ folder is empty.
– user611811
Dec 6 '17 at 17:30




I know, thank you for your explanation. This was supposed to be python script but I accidentally ran as bash script. I want to know, if folders are gone or copied somewhere else, I couldn't figure it out because I have the same exact disk space before I ran the script and /media/hdd/folder/folder1/Lisa/ folder is empty.
– user611811
Dec 6 '17 at 17:30












In the future, put a #!/usr/bin/env python at the top of your script to make sure your shell will run it as such. As for finding the files, we can't really help you. You could run find . -name "*Lisa*" to find any files/directories containing the string "Lisa" recursively in your current directory.
– John Moon
Dec 6 '17 at 17:35




In the future, put a #!/usr/bin/env python at the top of your script to make sure your shell will run it as such. As for finding the files, we can't really help you. You could run find . -name "*Lisa*" to find any files/directories containing the string "Lisa" recursively in your current directory.
– John Moon
Dec 6 '17 at 17:35












OK I found them. Let me explain, if I can... find . -iname Lisa* returns nothing. Command ls -larth shows nothing about Lisa, so as ls, but if I type cd Lisa. and hit Tab key cd enters Lisa.z..... folder and everything is there. I don't know why ls and ls -larth doesn't show this Lisa.z... folder I am really curious.
– user611811
Dec 6 '17 at 17:42





OK I found them. Let me explain, if I can... find . -iname Lisa* returns nothing. Command ls -larth shows nothing about Lisa, so as ls, but if I type cd Lisa. and hit Tab key cd enters Lisa.z..... folder and everything is there. I don't know why ls and ls -larth doesn't show this Lisa.z... folder I am really curious.
– user611811
Dec 6 '17 at 17:42













Both find and ls are able to find a folder named "Lisa.z" on my machine without special options. I'm not sure what's wrong with your setup.
– John Moon
Dec 6 '17 at 18:41




Both find and ls are able to find a folder named "Lisa.z" on my machine without special options. I'm not sure what's wrong with your setup.
– John Moon
Dec 6 '17 at 18:41


Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay