Ran wrong script, moved folders are gone, but where? [closed]
Clash 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.
bash shell-script mv
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.
add a comment |Â
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.
bash shell-script mv
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 runningfind
?
â G-Man
Dec 7 '17 at 0:42
add a comment |Â
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.
bash shell-script mv
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.
bash shell-script mv
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 runningfind
?
â G-Man
Dec 7 '17 at 0:42
add a comment |Â
4
Post the exact commands run, not an approximation.
â jasonwryan
Dec 6 '17 at 16:57
Have you tried runningfind
?
â 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
add a comment |Â
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.
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 runfind . -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
Bothfind
andls
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
add a comment |Â
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.
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 runfind . -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
Bothfind
andls
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
add a comment |Â
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.
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 runfind . -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
Bothfind
andls
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
add a comment |Â
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.
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.
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 runfind . -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
Bothfind
andls
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
add a comment |Â
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 runfind . -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
Bothfind
andls
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
add a comment |Â
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