fstyp command

You can use the fstyp command to find out what filesystem a device is.

# fstyp /dev/rdsk/c0d0s0
ufs

You could also use a shell script like so to determine all devices in the /dev/rdsk directory:

for i in /dev/rdsk/*; do echo “$i = $(fstyp $i 2>/dev/null)”; done

3 Responses to “fstyp command”

  1. Deniz Says:

    Hi Derek,
    I am new to solaris and shell scripting. When I looked to your shell script, I see that you wrote 2>/dev/null through the end. I was wondering what does this do exactly?
    Because when I replace that part with nothing I get more information (some of them are not necessary).
    Thanks

    Deniz Rende

  2. Derek Says:

    Deniz,

    Look up standard input and output on Unix.

    2>/dev/null means it is redirecting standard error (any output that is considered an error) to /dev/null

    0 = standard input
    1 = standard output
    2 = standard error

  3. Deniz Says:

    Thank you so much Derek!

Leave a Reply