java - How to find a user's home directory on linux or unix? -


How do I get an arbitrary user's home directory from within Grails? On Linux it is often / home / user, however, on some OS, for example OpenSolaris, such as path / export / home / user.

For Unix-like systems, you can use the shell to say " resonator ~ username" Code> "to execute (therefore use runtime.acac), {" / bin / sh "," -c "," echo ~ username "} to run . ).


Comments