제목에서 이를 설명합니다. WSL에 새 Linux를 설치했지만 랩톱에 기존 디렉터리가 표시되지 않습니다. 문제가 무엇인지 잘 모르겠고 문제를 평가하기 위해 온라인에서 여러 가지 방법을 시도했지만 소용이 없었습니다. 설치 오류이거나 Linux 멍청한 놈이라고 추측할 수 있습니다. 도움을 주셔서 감사합니다. 항목은 다음과 같습니다.
편집 1: 문제는 아래 코드에서 볼 수 있듯이 C:\Users\someuser\Documents와 같은 Windows 드라이브의 디렉터리에 액세스할 수 없다는 것입니다. ls를 사용하여 Linux 시스템에서 홈 디렉토리에 있어도 아무 것도 나타나지 않는 디렉토리를 찾습니다.
roman@DESKTOP-QKJTF3S:~$ which ls
/usr/bin/ls
roman@DESKTOP-QKJTF3S:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.UbuntuonWindows_2004.2021.825.0_x64__79rhkp1fndgsc:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/MATLAB/R2021a/runtime/win64:/mnt/c/Program Files/MATLAB/R2021a/bin:/mnt/c/Program Files (x86)/Windows Kits/8.1/Windows Performance Toolkit/:/mnt/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/110/Tools/Binn/:/mnt/c/Program Files (x86)/Microsoft SQL Server/120/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/120/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/120/DTS/Binn/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/roman/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/roman/AppData/Local/GitHubDesktop/bin:/mnt/c/Users/roman/AppData/Local/atom/bin:/snap/bin
roman@DESKTOP-QKJTF3S:~$ ls
roman@DESKTOP-QKJTF3S:~$ df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 459G 375G 85G 82% /
none 459G 375G 85G 82% /dev
none 459G 375G 85G 82% /run
none 459G 375G 85G 82% /run/lock
none 459G 375G 85G 82% /run/shm
none 459G 375G 85G 82% /run/user
tmpfs 459G 375G 85G 82% /sys/fs/cgroup
C:\ 459G 375G 85G 82% /mnt/c
roman@DESKTOP-QKJTF3S:~$ ls -la
total 8
drwxr-xr-x 1 roman roman 512 Feb 16 16:08 .
drwxr-xr-x 1 root root 512 Feb 9 15:08 ..
-rw------- 1 roman roman 285 Feb 16 16:08 .bash_history
-rw-r--r-- 1 roman roman 220 Feb 9 15:08 .bash_logout
-rw-r--r-- 1 roman roman 3771 Feb 9 15:08 .bashrc
drwxr-xr-x 1 roman roman 512 Feb 9 15:08 .landscape
-rw-r--r-- 1 roman roman 0 Feb 16 15:46 .motd_shown
-rw-r--r-- 1 roman roman 807 Feb 9 15:08 .profile
-rw-r--r-- 1 roman roman 0 Feb 9 15:11 .sudo_as_admin_successful
roman@DESKTOP-QKJTF3S:~$ type ls
ls is aliased to `ls --color=auto'
roman@DESKTOP-QKJTF3S:~$ dir
roman@DESKTOP-QKJTF3S:~$ ls
roman@DESKTOP-QKJTF3S:~$ mkdir tmp
roman@DESKTOP-QKJTF3S:~$ cd
roman@DESKTOP-QKJTF3S:~$ cd tmp
roman@DESKTOP-QKJTF3S:~/tmp$ ls
roman@DESKTOP-QKJTF3S:~/tmp$ cd
roman@DESKTOP-QKJTF3S:~$ ls
tmp
roman@DESKTOP-QKJTF3S:~$ cd
roman@DESKTOP-QKJTF3S:~$ find
.
./.bashrc
./.bash_history
./.bash_logout
./.landscape
./.landscape/sysinfo.log
./.motd_shown
./.profile
./.sudo_as_admin_successful
./tmp
roman@DESKTOP-QKJTF3S:~$ ls
tmp
roman@DESKTOP-QKJTF3S:~$
roman@DESKTOP-QKJTF3S:~$ pwd
/home/roman
roman@DESKTOP-QKJTF3S:~$ cd ~/Documents
-bash: cd: /home/roman/Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$ cd ./Documents
-bash: cd: ./Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$ cd ~/.Documents
-bash: cd: /home/roman/.Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$ cd ./Documents
-bash: cd: ./Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$ ~/Documents
-bash: /home/roman/Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$ ~/Documents$
-bash: /home/roman/Documents$: No such file or directory
roman@DESKTOP-QKJTF3S:~$ ~/Documents$ find
-bash: /home/roman/Documents$: No such file or directory
roman@DESKTOP-QKJTF3S:~$ cd Documents
-bash: cd: Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$ tmp
Command 'tmp' not found, but there are 16 similar ones.
roman@DESKTOP-QKJTF3S:~$ cd
roman@DESKTOP-QKJTF3S:~$ cd /tmp
roman@DESKTOP-QKJTF3S:/tmp$ cd
roman@DESKTOP-QKJTF3S:~$ ./.Documents
-bash: ./.Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$
편집 2: 현재 연결된 모든 파일 시스템을 표시하는 "마운트" 코드장소
roman@DESKTOP-QKJTF3S:~$ mount
rootfs on / type wslfs (rw,noatime)
none on /dev type tmpfs (rw,noatime,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,gid=5,mode=620)
none on /run type tmpfs (rw,nosuid,noexec,noatime,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,noatime)
none on /run/shm type tmpfs (rw,nosuid,nodev,noatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,noatime,mode=755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,mode=755)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
C:\ on /mnt/c type drvfs (rw,noatime,uid=1000,gid=1000,case=off)
roman@DESKTOP-QKJTF3S:~$ mount -t ext4
roman@DESKTOP-QKJTF3S:~$
편집 3: 진행됨에 따라 "c"라는 파일 시스템이 마운트되었지만 그 안의 파일이 일치하지 않는 것을 발견했습니다.
roman@DESKTOP-QKJTF3S:~$ /mnt
-bash: /mnt: Is a directory
roman@DESKTOP-QKJTF3S:~$ /mnt/c
-bash: /mnt/c: Is a directory
roman@DESKTOP-QKJTF3S:~$ cd /mnt/c
roman@DESKTOP-QKJTF3S:/mnt/c$ cd /users
-bash: cd: /users: No such file or directory
roman@DESKTOP-QKJTF3S:/mnt/c$ cd /Users
-bash: cd: /Users: No such file or directory
roman@DESKTOP-QKJTF3S:/mnt/c$ ls
ls: cannot access 'DumpStack.log.tmp': Permission denied
ls: cannot access 'hiberfil.sys': Permission denied
ls: cannot access 'pagefile.sys': Permission denied
ls: cannot access 'swapfile.sys': Permission denied
'$Recycle.Bin' ProgramData eula.3082.txt
'$WinREAgent' Recovery globdata.ini
Apps 'SOLIDWORKS Data' hiberfil.sys
Config.Msi 'SOLIDWORKS Data (2)' install.exe
Dell 'System Volume Information' install.ini
'Documents and Settings' Users install.res.1028.dll
Downloads VC_RED.MSI install.res.1031.dll
Drivers VC_RED.cab install.res.1033.dll
DumpStack.log Windows install.res.1036.dll
DumpStack.log.tmp cygwin64 install.res.1040.dll
Games dell.sdr install.res.1041.dll
Intel eula.1028.txt install.res.1042.dll
NvContainerRecoveryNVDisplay.ContainerLocalSystem.reg eula.1031.txt install.res.2052.dll
NvContainerRecoveryNvBroadcast.ContainerLocalSystem.reg eula.1033.txt install.res.3082.dll
NvContainerRecoveryNvContainerLocalSystem.reg eula.1036.txt pagefile.sys
OneDriveTemp eula.1040.txt swapfile.sys
PerfLogs eula.1041.txt temp
'Program Files' eula.1042.txt vcredist.bmp
'Program Files (x86)' eula.2052.txt
roman@DESKTOP-QKJTF3S:/mnt/c$ cd /Documents and Settings
-bash: cd: too many arguments
roman@DESKTOP-QKJTF3S:/mnt/c$ cd /Documents
-bash: cd: /Documents: No such file or directory
roman@DESKTOP-QKJTF3S:/mnt/c$ cd /Downloads
-bash: cd: /Downloads: No such file or directory
roman@DESKTOP-QKJTF3S:/mnt/c$ cd ./Downloads
roman@DESKTOP-QKJTF3S:/mnt/c/Downloads$ cd
roman@DESKTOP-QKJTF3S:~$ cd /mnt/c/.Documents
-bash: cd: /mnt/c/.Documents: No such file or directory
roman@DESKTOP-QKJTF3S:~$ cd /mnt/c
roman@DESKTOP-QKJTF3S:/mnt/c$ cd ./Documents
-bash: cd: ./Documents: No such file or directory
roman@DESKTOP-QKJTF3S:/mnt/c$ cd ./Documents and Settings
-bash: cd: too many arguments
roman@DESKTOP-QKJTF3S:/mnt/c$ cd ./Documents_and_Settings
-bash: cd: ./Documents_and_Settings: No such file or directory
roman@DESKTOP-QKJTF3S:/mnt/c$ cd ./Downloads
roman@DESKTOP-QKJTF3S:/mnt/c/Downloads$ ls
Updater_SA_Upgrade
roman@DESKTOP-QKJTF3S:/mnt/c/Downloads$ ls -la
total 0
drwxrwxrwx 1 roman roman 512 Apr 16 2020 .
drwxrwxrwx 1 roman roman 512 Feb 11 17:47 ..
drwxrwxrwx 1 roman roman 512 Apr 16 2020 Updater_SA_Upgrade
roman@DESKTOP-QKJTF3S:/mnt/c/Downloads$
답변1
Windows Store를 통해 WSL Ubuntu Linux를 설치하면 Windows C: 드라이브가 Linux 시스템에 설치되며 /mnt/c/
.Documents 폴더에서 찾을 수 있습니다 /mnt/c/Users/someuser/Documents
. cd
(를 사용하여 작업 디렉터리를 C: 드라이브로 변경할 수 있습니다 .씨매다는 사람디디렉토리) 좋아요cd /mnt/c/
@mashuptwice가 나 같은 멍청이를 안내해 주면 그들은 흔들릴 것입니다.