Simply read /etc/mtab; it shows all mounted drives ( strictly it shows all mounts ) .
Tim, do you know whether that will that work on Solaris, FreeBSD, OSX as well?
Nice, I have put it in the wiki in a new page for linux tips: ...
Quote from: BigChimp on February 10, 2012, 09:58:18 amTim, do you know whether that will that work on Solaris, FreeBSD, OSX as well?AFAIK it should work with all unix-like systems, IIRC it's a Unix SysV thing...
/proc
/proc/partitions
/proc/mounts
/proc/cpuinfo
/proc/meminfo
/proc/self/net/arp
/proc/bus/input/devices
/proc/sys
This is a mistakeMtab contains information for * how to mount FS*
The programs mount and umount maintain a list of currently mounted filesystems in the file /etc/mtab. If no arguments are given to mount, this list is printed.
When the proc filesystem is mounted (say at /proc), the files /etc/mtab and /proc/mounts have very similar contents.
Also mtab can be used on many different unix OS-es, while linux procfs is, well, linux specific...
Hmm.* how to mount FS* = fstab* what is mounted* = mtab
Now I wonder if there exists a POSIX standard for this...