mkdir MOUNTPOINT mount tmpfs MOUNTPOINT -t tmpfs
Creating a tmpfs filesystem with a maximum size is easy. To create a new tmpfs filesystem with a maximum filesystem size of 32 MB, type:
mount tmpfs /dev/shm -t tmpfs -o size=32m
This time, instead of mounting our new tmpfs filesystem at /mnt/tmpfs, we created it at /dev/shm, which is a directory that happens to be the "official" mountpoint for a tmpfs filesystem. If you happen to be using devfs, you'll find that this directory has already been created for you.
Also, if we want to limit the filesystem size to 512 KB or 1 GB, we can specify size=512k and size=1g, respectively. In addition to limiting size, we can also limit the number of inodes (filesystem objects) by specifying the nr_inodes=x parameter. When using nr_inodes, x can be a simple integer, and can also be followed with a k, m, or g to specify thousands, millions, or billions (!) of inodes.
Also, if you'd like to add the equivalent of the above mount tmpfs command to your /etc/fstab, it'd look like this:
tmpfs /dev/shm tmpfs size=32m 0 0