拱门Linux。
我的 NAS 上有一个 CIFS 挂载,并且已使用完全权限挂载
# line from my fstab
//IP_ADDRESS/path/to/dir /path/to/local/dir cifs uid=my_user,gid=my_group,dir_mode=0777,file_mode=0777,credentials=path/to/my/creds 0 0
我正在尝试创建一个目录,但是失败了
mkdir path/to/local/dir/subdir
mkdir: cannot create directory '/path/to/local/dir/subdir': File exists
但据我所知不存在:
ls -la path/to/local/dir
drwxrwxrwx me me 0 date .
drwxrwxrwx me me 0 date ..
查看我的 NAS 上的文件,该子目录在远程上不存在。我很困惑。我可以搜索这个,它只会出现一堆人们不明白点文件是什么的结果。
是什么赋予了?
编辑
由于我在细节上遇到了一些阻力(很公平),以下是精确的命令和输出。该/mnt/nas/SteamLibrary
文件夹是 NAS 上文件夹的本地挂载点。
[I] ⋊> ~ ls -la /mnt/nas/SteamLibrary/steamapps/downloading
17:19:56ls: cannot access '/mnt/nas/SteamLibrary/steamapps/downloading': No such file or directory
[I] ⋊> ~ mkdir /mnt/nas/SteamLibrary/steamapps/downloading
17:20:33mkdir: cannot create directory ‘/mnt/nas/SteamLibrary/steamapps/downloading’: File exists
[I] ⋊> ~ ls -la /mnt/nas/SteamLibrary/steamapps/
17:20:41total 108K
drwxrwxrwx 2 jsmith jsmith 0 Apr 18 21:30 .
drwxrwxrwx 2 jsmith jsmith 0 Apr 19 13:49 ..
drwxrwxrwx 2 jsmith jsmith 0 Apr 17 16:05 common
drwxrwxrwx 2 jsmith jsmith 0 Apr 17 16:04 compatdata
drwxrwxrwx 2 jsmith jsmith 0 Apr 17 16:03 shadercache
drwxrwxrwx 2 jsmith jsmith 0 Apr 17 16:05 temp
drwxrwxrwx 2 jsmith jsmith 0 Aug 10 2020 workshop
-rwxrwxrwx 1 jsmith jsmith 1.2K Feb 27 16:40 appmanifest_102500.acf
-rwxrwxrwx 1 jsmith jsmith 686 Feb 27 16:40 appmanifest_107300.acf
-rwxrwxrwx 1 jsmith jsmith 694 Feb 27 16:40 appmanifest_107310.acf
-rwxrwxrwx 1 jsmith jsmith 498 Apr 19 13:50 appmanifest_1391110.acf
-rwxrwxrwx 1 jsmith jsmith 483 Apr 19 13:50 appmanifest_1493710.acf
-rwxrwxrwx 1 jsmith jsmith 745 Feb 27 16:40 appmanifest_207320.acf
-rwxrwxrwx 1 jsmith jsmith 863 Feb 27 16:41 appmanifest_219780.acf
-rwxrwxrwx 1 jsmith jsmith 691 Apr 17 16:03 appmanifest_22320.acf
-rwxrwxrwx 1 jsmith jsmith 837 Apr 19 13:50 appmanifest_22330.acf
-rwxrwxrwx 1 jsmith jsmith 516 Feb 27 16:59 appmanifest_256460.acf
-rwxrwxrwx 1 jsmith jsmith 1.2K Feb 27 16:59 appmanifest_292030.acf
-rwxrwxrwx 1 jsmith jsmith 825 Feb 27 16:40 appmanifest_312540.acf
-rwxrwxrwx 1 jsmith jsmith 1.1K Apr 17 16:03 appmanifest_340170.acf
-rwxrwxrwx 1 jsmith jsmith 1.1K Feb 27 16:40 appmanifest_351970.acf
-rwxrwxrwx 1 jsmith jsmith 894 Feb 27 16:40 appmanifest_367500.acf
-rwxrwxrwx 1 jsmith jsmith 773 Feb 27 16:40 appmanifest_372360.acf
-rwxrwxrwx 1 jsmith jsmith 1.5K Feb 27 16:37 appmanifest_379720.acf
-rwxrwxrwx 1 jsmith jsmith 599 Apr 17 16:20 appmanifest_391540.acf
-rwxrwxrwx 1 jsmith jsmith 665 Apr 19 13:49 appmanifest_406110.acf
-rwxrwxrwx 1 jsmith jsmith 685 Feb 27 16:59 appmanifest_418340.acf
-rwxrwxrwx 1 jsmith jsmith 794 Feb 27 16:40 appmanifest_429660.acf
-rwxrwxrwx 1 jsmith jsmith 985 Feb 27 16:40 appmanifest_489830.acf
-rwxrwxrwx 1 jsmith jsmith 612 Feb 27 16:59 appmanifest_506510.acf
-rwxrwxrwx 1 jsmith jsmith 667 Feb 27 16:41 appmanifest_522530.acf
-rwxrwxrwx 1 jsmith jsmith 708 Feb 27 16:41 appmanifest_525240.acf
-rwxrwxrwx 1 jsmith jsmith 891 Apr 17 16:03 appmanifest_538680.acf
-rwxrwxrwx 1 jsmith jsmith 1.1K Feb 27 16:40 appmanifest_72850.acf
答案1
ls -la /path/to/dir
列出(除必填.
和..
条目外为空)内容的dir
。
使用该-d
选项查看目录本身,例如
ls -ld /path/to/dir
阅读man ls
有很多选择。在脚本中man stat
犯“解析”错误之前请先阅读。ls