在Linux環境下,可以通過修改~/.bashrc或~/.bash_profile文件來設置user.home,具體步驟如下:
~/.bashrc或~/.bash_profile文件:vi ~/.bashrc
或者
vi ~/.bash_profile
user.home設置為/home/user1):export HOME=/home/user1
source ~/.bashrc
或者
source ~/.bash_profile
user.home就被設置為/home/user1了。請注意,這種設置只會在當前用戶的會話中生效,如果想要在系統級別設置user.home,可以修改/etc/profile文件。