免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 10460 | 回复: 5
打印 上一主题 下一主题

[系统管理] 目录改名导致目录进去不了 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-08-14 10:10 |只看该作者 |倒序浏览
各位大侠,
AIX7.1下一oracle 数据文件目录testdb, 本是想通过目录改名将数据文件备份起来,
结果不心名字弄错了,用了这个命令"mv testdb testdb",结果悲剧了。
现进testdb目录提示目录不存在,请问各位大侠,如何把testdb还原出来?先谢谢啦。
$ cd testdb
ksh: testdb:  not found.

论坛徽章:
0
2 [报告]
发表于 2013-08-14 10:36 |只看该作者
目录存在,但进不去,我想testdb这个名字中可能有特殊字符了。各位有什么办法没有?
$ ls -l
total 48
drwxr-xr-x    2 oracle   oinstall        256 Aug 14 09:17 testdb___
drwxr-xr-x    2 oracle   oinstall       4096 Jul 30 13:56 testdb_bk
drwxr-xr-x    2 oracle   oinstall       4096 Aug 02 09:56 testdb

$ du -sg *
0.00    testdb___
8.86    testdb_bk
9.29    testdb

$ cd testdb
ksh: testdb:  not found.

论坛徽章:
0
3 [报告]
发表于 2013-08-14 11:43 |只看该作者
我把原来那个testdb___改名成testdb也可以的,出现下面的情况,但原来的文件我要弄出来。
$ ls -l
total 56
drwxr-xr-x    2 oracle   oinstall       4096 Aug 14 11:06 testdb
drwxr-xr-x    2 oracle   oinstall       4096 Jul 30 13:56 testdb_bk
drwxr-xr-x    2 oracle   oinstall       4096 Aug 02 09:56 testdb

$ ls -li
total 56
36960 drwxr-xr-x    2 oracle   oinstall       4096 Aug 14 11:06 testdb
36896 drwxr-xr-x    2 oracle   oinstall       4096 Jul 30 13:56 testdb_bk
32800 drwxr-xr-x    2 oracle   oinstall       4096 Aug 02 09:56 testdb


$ ls -l | awk '{print $9}'

testdb
testdb_bk
testdb

$ ls -l | awk '{print $9}' >1.txt

$vi 1.txt
testdb
testdb_bk
testdb_^?

看到怪字符了,testdb_^?, 但还是进不去。
$ cd testdb_^?
bash: cd: testdb_^?: A file or directory in the path name does not exist.

论坛徽章:
0
4 [报告]
发表于 2013-08-14 15:05 |只看该作者
已经搞定,将其他几个test开头的目录改名,然后cd test* 就可以了。

论坛徽章:
0
5 [报告]
发表于 2013-08-29 01:42 |只看该作者
有意思,还真没试过

论坛徽章:
0
6 [报告]
发表于 2013-09-10 12:04 |只看该作者
$ cd testdb_^?可以使用$ cd testdb\_\^\?转义的应该
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP