答案1
您需要对要将文件复制到的目录具有写权限。您可以使用以下命令进行检查:
ls -l -a
输出如下所示。
username@machine:~$ ls -l -a
insgesamt 1336
drwxr-xr-x 9 username usergroup 4096 Mär 15 20:16 .
drwxr-xr-x 3 root root 4096 Okt 15 2015 ..
-rw------- 1 username usergroup 33899 Mär 16 11:44 .bash_history
-rw-r--r-- 1 username usergroup 220 Okt 15 2015 .bash_logout
-rw-r--r-- 1 username usergroup 3637 Okt 15 2015 .bashrc
第一行末尾带有“.”的字符代表当前目录。在第一列中,您可以看到“drwxr-xr-x”,意思是:
d: it is a directory
r: file (directory) owner has read access
w: file (directory) owner has write access
x: file (directory) owner can execute
r: file (directory) group has read access
-: file (directory) group has NO write access
x: file (directory) group can execute
r: all other have read access
-: all other have NO write access
x: all other can execute
在非常正常的设置中,您应该对主目录具有写权限。您可以通过键入 来更改那里cd ~
。然后尝试将您的文件复制到此位置。