
在 Debian 上,我有多個硬碟,我如何知道 /var/www 在哪裡?
附贈:如何檢查我的驅動器的容量和已消耗的容量?
答案1
你沒有提到你的作業系統,但在 Linux 上,這是有效的:
$ df /path/to/some/file/or/directory
Filesystem 1k-blks Used Avail Cap Mounted
/dev/harddisk_partition 8388348 5187768 3200580 62% /home/username
^^^^^^^^^^^^^^^^^^
答案2
您可以/var/www
透過使用命令檢查它(或/var
)的安裝位置來找到它的位置mount
。
若要檢查磁碟機上的可用/已使用空間,請嘗試df
(或df -h
取得更具可讀性的輸出)。它將顯示所有已安裝分割區中的已使用空間和可用空間。例如
-> % df -kh
Sist. Arq. Tam Usad Dispon. Uso% Montado em
rootfs 94G 34G 60G 36% /
/dev 2,9G 0 2,9G 0% /dev
run 2,9G 484K 2,9G 1% /run
/dev/sda1 94G 34G 60G 36% /
[... the rest was snipped, I have many more partitions ...]
另外,df /path/to/file
可以工作(至少在 Linux 上):
-> % df /var/log
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 97667596 34853688 62813908 36% /
答案3
用於mount
查看您的磁碟安裝點。尋找最長的匹配項,/var/www
這就是您的磁碟。就我而言,它是/dev/sda2
.
[mpenning@Bucksnort ~]$ mount
/dev/sda2 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
[mpenning@Bucksnort ~]$
每個安裝點的驅動器空間消耗(以 KB 為單位):
[mpenning@Bucksnort ~]$ df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 30759872 22835672 6361680 79% /
tmpfs 1947664 12 1947652 1% /lib/init/rw
udev 1943240 104 1943136 1% /dev
tmpfs 1947664 0 1947664 0% /dev/shm
/dev/sda1 1441280 67136 1300928 5% /boot
[mpenning@Bucksnort ~]$