My university has a system set up where each class has its own directory for the professors to publish and receive files. These directories reside under a directory in /home which happens to be a mounted disk and are accessible anywhere in the system by referencing ~csXXX where csXXX is a sub-directory within that home directory.

How are they doing this and how can I do it on my own systems?

up vote 5 down vote accepted

There's nothing special about what they're doing, it's just standard shell behavior. (I'm not sure that all shells do this, but at least most of the common ones do, e.g. bash) ~ expands to the home directory of the current user, and ~username expands to the home directory of the named user. So it appears that all they've done is set up one user account for each class.

When I was an undergrad the CS department used the same system. I'm sure it's fairly common.

  • That's sensible, and does appear to be the case. I hadn't known about the username expansion before, thanks. – Chris Sep 10 '10 at 23:23

~ is usually an alias for a user's home directory. In this case, perhaps users of a class share a home directory?

You can see this by typing echo ~ and it should spit out a full path and you can see a user's home directory with finger.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.