What happens when I try to change to a parent directory after it has been renamed?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I'm several child directories deep and I enter cd ..
and receive this error:
cd: ..: No such file or directory
I am confused- of course there is a parent directory, I'm in it! A little digging shows that my coworker renamed a grandparent directory out from under me and when I tried to move to my parent directory, I got the above error. I tried to reproduce this like so:
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/TEMPTEST/SUB1/SUB2
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> mv /n01/data/adf/temp/TEMPTEST /n01/data/adf/temp/NEWTEMPTEST
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/NEWTEMPTEST/SUB1/SUB2
And now I am lost and adrift, changing to the parent directory will give me the same error as before.
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> cd ..
server|/n01/data/adf/temp/NEWTEMPTEST/SUB1>
No error. I changed directories successfully. What happened? Why didn't this error like the first time?
cd-command
add a comment |Â
up vote
1
down vote
favorite
I'm several child directories deep and I enter cd ..
and receive this error:
cd: ..: No such file or directory
I am confused- of course there is a parent directory, I'm in it! A little digging shows that my coworker renamed a grandparent directory out from under me and when I tried to move to my parent directory, I got the above error. I tried to reproduce this like so:
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/TEMPTEST/SUB1/SUB2
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> mv /n01/data/adf/temp/TEMPTEST /n01/data/adf/temp/NEWTEMPTEST
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/NEWTEMPTEST/SUB1/SUB2
And now I am lost and adrift, changing to the parent directory will give me the same error as before.
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> cd ..
server|/n01/data/adf/temp/NEWTEMPTEST/SUB1>
No error. I changed directories successfully. What happened? Why didn't this error like the first time?
cd-command
@RubberStamp I was able to recreate the same behavior using one shell to create and enter the test directory and another shell to rename it.
â MackM
Nov 18 '17 at 0:13
I left out the very relevant information that the first error I saw was on a EMC Isilon mount, and my attempted recreation was on the server's local disk.
â MackM
Nov 18 '17 at 0:26
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm several child directories deep and I enter cd ..
and receive this error:
cd: ..: No such file or directory
I am confused- of course there is a parent directory, I'm in it! A little digging shows that my coworker renamed a grandparent directory out from under me and when I tried to move to my parent directory, I got the above error. I tried to reproduce this like so:
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/TEMPTEST/SUB1/SUB2
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> mv /n01/data/adf/temp/TEMPTEST /n01/data/adf/temp/NEWTEMPTEST
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/NEWTEMPTEST/SUB1/SUB2
And now I am lost and adrift, changing to the parent directory will give me the same error as before.
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> cd ..
server|/n01/data/adf/temp/NEWTEMPTEST/SUB1>
No error. I changed directories successfully. What happened? Why didn't this error like the first time?
cd-command
I'm several child directories deep and I enter cd ..
and receive this error:
cd: ..: No such file or directory
I am confused- of course there is a parent directory, I'm in it! A little digging shows that my coworker renamed a grandparent directory out from under me and when I tried to move to my parent directory, I got the above error. I tried to reproduce this like so:
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/TEMPTEST/SUB1/SUB2
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> mv /n01/data/adf/temp/TEMPTEST /n01/data/adf/temp/NEWTEMPTEST
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/NEWTEMPTEST/SUB1/SUB2
And now I am lost and adrift, changing to the parent directory will give me the same error as before.
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> cd ..
server|/n01/data/adf/temp/NEWTEMPTEST/SUB1>
No error. I changed directories successfully. What happened? Why didn't this error like the first time?
cd-command
asked Nov 17 '17 at 23:47
MackM
1105
1105
@RubberStamp I was able to recreate the same behavior using one shell to create and enter the test directory and another shell to rename it.
â MackM
Nov 18 '17 at 0:13
I left out the very relevant information that the first error I saw was on a EMC Isilon mount, and my attempted recreation was on the server's local disk.
â MackM
Nov 18 '17 at 0:26
add a comment |Â
@RubberStamp I was able to recreate the same behavior using one shell to create and enter the test directory and another shell to rename it.
â MackM
Nov 18 '17 at 0:13
I left out the very relevant information that the first error I saw was on a EMC Isilon mount, and my attempted recreation was on the server's local disk.
â MackM
Nov 18 '17 at 0:26
@RubberStamp I was able to recreate the same behavior using one shell to create and enter the test directory and another shell to rename it.
â MackM
Nov 18 '17 at 0:13
@RubberStamp I was able to recreate the same behavior using one shell to create and enter the test directory and another shell to rename it.
â MackM
Nov 18 '17 at 0:13
I left out the very relevant information that the first error I saw was on a EMC Isilon mount, and my attempted recreation was on the server's local disk.
â MackM
Nov 18 '17 at 0:26
I left out the very relevant information that the first error I saw was on a EMC Isilon mount, and my attempted recreation was on the server's local disk.
â MackM
Nov 18 '17 at 0:26
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
5
down vote
accepted
Renaming the parent directory will not cause such an error. However, deleting will, for instance:
# mkdir -p some/deep/path
# cd some/deep/path
# rm -r some/deep/path
# cd ..
error: No such file or directory
There is no "rename" command per se in Linux. You can "move" things around though. When moving within the same filesystem, this equates to a rename. However, when moving between filsystems, this is effectively a copy / delete operation, which could result in a similar situation as that shown above, for instance:
# mkdir -p /fs1/a/b
# cd /fs1/a/b
# mv /fs1/a /fs2/a
# cd ..
error: No such file or directory
when /fs1
and /fs2
are different filesystems (mount points in this case).
The 'rename was done withmv
in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant.
â MackM
Nov 18 '17 at 0:16
add a comment |Â
up vote
1
down vote
Simply renaming the directory would have accomplished nothing, because the name is just a label (that's how you can have two files pointing at the same object using hard links).
The parent directory's content was probably moved into a new directory, and the old directory, now empty, destroyed. This needs to be done while you're in the immediate child directory, I think.
This also happens if you move the directory around between different mounted filesystems while (optionally) renaming it; it's not the rename, but the filesystem change that forces the original to be deleted.
The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant .
â MackM
Nov 18 '17 at 0:18
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
Renaming the parent directory will not cause such an error. However, deleting will, for instance:
# mkdir -p some/deep/path
# cd some/deep/path
# rm -r some/deep/path
# cd ..
error: No such file or directory
There is no "rename" command per se in Linux. You can "move" things around though. When moving within the same filesystem, this equates to a rename. However, when moving between filsystems, this is effectively a copy / delete operation, which could result in a similar situation as that shown above, for instance:
# mkdir -p /fs1/a/b
# cd /fs1/a/b
# mv /fs1/a /fs2/a
# cd ..
error: No such file or directory
when /fs1
and /fs2
are different filesystems (mount points in this case).
The 'rename was done withmv
in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant.
â MackM
Nov 18 '17 at 0:16
add a comment |Â
up vote
5
down vote
accepted
Renaming the parent directory will not cause such an error. However, deleting will, for instance:
# mkdir -p some/deep/path
# cd some/deep/path
# rm -r some/deep/path
# cd ..
error: No such file or directory
There is no "rename" command per se in Linux. You can "move" things around though. When moving within the same filesystem, this equates to a rename. However, when moving between filsystems, this is effectively a copy / delete operation, which could result in a similar situation as that shown above, for instance:
# mkdir -p /fs1/a/b
# cd /fs1/a/b
# mv /fs1/a /fs2/a
# cd ..
error: No such file or directory
when /fs1
and /fs2
are different filesystems (mount points in this case).
The 'rename was done withmv
in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant.
â MackM
Nov 18 '17 at 0:16
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
Renaming the parent directory will not cause such an error. However, deleting will, for instance:
# mkdir -p some/deep/path
# cd some/deep/path
# rm -r some/deep/path
# cd ..
error: No such file or directory
There is no "rename" command per se in Linux. You can "move" things around though. When moving within the same filesystem, this equates to a rename. However, when moving between filsystems, this is effectively a copy / delete operation, which could result in a similar situation as that shown above, for instance:
# mkdir -p /fs1/a/b
# cd /fs1/a/b
# mv /fs1/a /fs2/a
# cd ..
error: No such file or directory
when /fs1
and /fs2
are different filesystems (mount points in this case).
Renaming the parent directory will not cause such an error. However, deleting will, for instance:
# mkdir -p some/deep/path
# cd some/deep/path
# rm -r some/deep/path
# cd ..
error: No such file or directory
There is no "rename" command per se in Linux. You can "move" things around though. When moving within the same filesystem, this equates to a rename. However, when moving between filsystems, this is effectively a copy / delete operation, which could result in a similar situation as that shown above, for instance:
# mkdir -p /fs1/a/b
# cd /fs1/a/b
# mv /fs1/a /fs2/a
# cd ..
error: No such file or directory
when /fs1
and /fs2
are different filesystems (mount points in this case).
answered Nov 18 '17 at 0:06
isedev
1763
1763
The 'rename was done withmv
in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant.
â MackM
Nov 18 '17 at 0:16
add a comment |Â
The 'rename was done withmv
in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant.
â MackM
Nov 18 '17 at 0:16
The 'rename was done with
mv
in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant.â MackM
Nov 18 '17 at 0:16
The 'rename was done with
mv
in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant.â MackM
Nov 18 '17 at 0:16
add a comment |Â
up vote
1
down vote
Simply renaming the directory would have accomplished nothing, because the name is just a label (that's how you can have two files pointing at the same object using hard links).
The parent directory's content was probably moved into a new directory, and the old directory, now empty, destroyed. This needs to be done while you're in the immediate child directory, I think.
This also happens if you move the directory around between different mounted filesystems while (optionally) renaming it; it's not the rename, but the filesystem change that forces the original to be deleted.
The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant .
â MackM
Nov 18 '17 at 0:18
add a comment |Â
up vote
1
down vote
Simply renaming the directory would have accomplished nothing, because the name is just a label (that's how you can have two files pointing at the same object using hard links).
The parent directory's content was probably moved into a new directory, and the old directory, now empty, destroyed. This needs to be done while you're in the immediate child directory, I think.
This also happens if you move the directory around between different mounted filesystems while (optionally) renaming it; it's not the rename, but the filesystem change that forces the original to be deleted.
The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant .
â MackM
Nov 18 '17 at 0:18
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Simply renaming the directory would have accomplished nothing, because the name is just a label (that's how you can have two files pointing at the same object using hard links).
The parent directory's content was probably moved into a new directory, and the old directory, now empty, destroyed. This needs to be done while you're in the immediate child directory, I think.
This also happens if you move the directory around between different mounted filesystems while (optionally) renaming it; it's not the rename, but the filesystem change that forces the original to be deleted.
Simply renaming the directory would have accomplished nothing, because the name is just a label (that's how you can have two files pointing at the same object using hard links).
The parent directory's content was probably moved into a new directory, and the old directory, now empty, destroyed. This needs to be done while you're in the immediate child directory, I think.
This also happens if you move the directory around between different mounted filesystems while (optionally) renaming it; it's not the rename, but the filesystem change that forces the original to be deleted.
edited Nov 18 '17 at 13:12
answered Nov 18 '17 at 0:06
LSerni
2,326615
2,326615
The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant .
â MackM
Nov 18 '17 at 0:18
add a comment |Â
The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant .
â MackM
Nov 18 '17 at 0:18
The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant .
â MackM
Nov 18 '17 at 0:18
The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant .
â MackM
Nov 18 '17 at 0:18
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%2f405370%2fwhat-happens-when-i-try-to-change-to-a-parent-directory-after-it-has-been-rename%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
@RubberStamp I was able to recreate the same behavior using one shell to create and enter the test directory and another shell to rename it.
â MackM
Nov 18 '17 at 0:13
I left out the very relevant information that the first error I saw was on a EMC Isilon mount, and my attempted recreation was on the server's local disk.
â MackM
Nov 18 '17 at 0:26