Nguyễn Hào
New member
How do I find my home path in Linux?
Answer
home” property would be the easiest way to get the current user home directory. To get an arbitrary user home directory, it takes a bit of finesse with the command line:
String[] command = {“/bin/sh”
, “-c”, “echo ~root”}; //substitute desired username Process outsideProcess = rt. exec(command); outsideProcess.
Answer
home” property would be the easiest way to get the current user home directory. To get an arbitrary user home directory, it takes a bit of finesse with the command line:
String[] command = {“/bin/sh”
, “-c”, “echo ~root”}; //substitute desired username Process outsideProcess = rt. exec(command); outsideProcess.