ln命令時(shí)提示:ln: 正在訪問"/a/afile": 沒有那個(gè)文件或目錄
[root@localhost a]# ll
總用量 8
-rw-r--r--. 1 root root ? ?0 12月 18 07:00 afile
drwxr-xr-x. 2 root root 4096 12月 11 07:17 b
drwxr-xr-x. 2 root root 4096 12月 18 07:08 tmp
[root@localhost a]# cd ..
[root@localhost ~]# ll
總用量 64
drwxr-xr-x. 4 root root ?4096 12月 18 07:08 a
-rw-r--r--. 1 root root ? ?17 12月 11 08:08 aa.txt
-rw-------. 1 root root ?1272 12月 ?7 08:27 anaconda-ks.cfg
drwxr-xr-x. 2 root root ?4096 12月 11 07:17 b
-rw-r--r--. 1 root root 26150 12月 ?7 08:27 install.log
-rw-r--r--. 1 root root ?7572 12月 ?7 08:23 install.log.syslog
drwxr-xr-x. 2 root root ?4096 12月 18 06:49 mytest
drwxr-xr-x. 2 root root ?4096 12月 10 08:08 test
[root@localhost ~]# mkdir tmp
[root@localhost ~]# ll
總用量 68
drwxr-xr-x. 4 root root ?4096 12月 18 07:08 a
-rw-r--r--. 1 root root ? ?17 12月 11 08:08 aa.txt
-rw-------. 1 root root ?1272 12月 ?7 08:27 anaconda-ks.cfg
drwxr-xr-x. 2 root root ?4096 12月 11 07:17 b
-rw-r--r--. 1 root root 26150 12月 ?7 08:27 install.log
-rw-r--r--. 1 root root ?7572 12月 ?7 08:23 install.log.syslog
drwxr-xr-x. 2 root root ?4096 12月 18 06:49 mytest
drwxr-xr-x. 2 root root ?4096 12月 10 08:08 test
drwxr-xr-x. 2 root root ?4096 12月 18 07:08 tmp
[root@localhost ~]# ln /a/afile /tmp/afile.hard
ln: 正在訪問"/a/afile": 沒有那個(gè)文件或目錄
2015-12-18
?Linux系統(tǒng)中,/ 反斜杠代表根目錄,敢問樓主的a目錄是否在根目錄下建的,如果不是 /a/afile 的路徑自然會(huì)報(bào)錯(cuò),其后的 /temp/afile.hard也會(huì)報(bào)錯(cuò),建議樓主進(jìn)入a目錄中用pwd命令取到文件的絕對(duì)路徑,然后在用ln命令