Questions tagged [home-directory]

A home directory is a file system directory on a multi-user operating system containing files for a given user of the system.

As defined by Wikipedia: "A home directory is a file system directory on a multi-user operating system containing files for a given user of the system." Although specifics may vary from system to system, a general convention is that executable programs and system wide configurations are stored in shared directories while users' home directories are reserved for their personal information, be it password files, documents or even source code they're developing.

174 questions
974
votes
3 answers

How to get the home directory in Python?

I need to get the location of the home directory of the current logged-on user. Currently, I've been using the following on Linux: os.getenv("HOME") However, this does not work on Windows. What is the correct cross-platform way to do this?
Nathan Osman
  • 63,773
  • 66
  • 242
  • 344
314
votes
9 answers

What is the best way to find the users home directory in Java?

The difficulty is that it should be cross platform. Windows 2000, XP, Vista, OSX, Linux, other unix variants. I am looking for a snippet of code that can accomplish this for all platforms, and a way to detect the platform. Now, you should be aware…
Bruno Ranschaert
  • 6,771
  • 4
  • 34
  • 42
264
votes
11 answers

What is the alternative for ~ (user's home directory) on Windows command prompt?

I'm trying to use the command prompt to move some files, I am used to the linux terminal where I use ~ to specify the my home directory I've looked everywhere but I couldn't seem to find it for windows command prompt (Documents and Settings\[user])
fenerlitk
  • 4,364
  • 9
  • 26
  • 37
247
votes
5 answers

Node.js - Find home directory in platform agnostic way

Process.platform returns "win32" for Windows. On Windows a user's home directory might be C:\Users[USERNAME] or C:\Documents and Settings[USERNAME] depending on which version of Windows is being used. On Unix this isn't an issue.
121
votes
2 answers

How to copy directories in OS X 10.7.3?

Hi I'm trying to copy my rails_projects directory from haseebjaved/Desktop/rails_projects to my home directory, which is haseebjaved. How can I do this via the Command Line? Also, can I see my home directory on the UI or only via the Command Line in…
hjaved
  • 1,255
  • 2
  • 9
  • 10
109
votes
8 answers

Meaning of tilde in Linux bash (not home directory)

First off, I know that ~/ is the home directory. CDing to ~ or ~/ takes me to the home directory. However, cd ~X takes me to a special place, where X seems to be anything. In bash, if I hit "cd ~" and hit tab, it shows a bunch of possible ~X options…
jbu
  • 14,925
  • 29
  • 80
  • 100
99
votes
7 answers

Obtain user's home directory

Is the following the best way of obtaining the running user's home directory? Or is there a specific function that I've ovelooked? os.Getenv("HOME") If the above is correct, does anyone happen to know whether this approach is guaranteed to work on…
Paul Ruane
  • 34,423
  • 11
  • 60
  • 77
81
votes
9 answers

How to find the real user home directory using python?

I see that if we change the HOME(linux) or USERPROFILE(windows) environmental variable and run a python script, it returns the new value as the user home when I tried, os.environ['HOME'] os.exp Is there any way to find the real user home directory…
asdfg
  • 2,251
  • 2
  • 25
  • 24
53
votes
3 answers

Android Get Application's 'Home' Data Directory

A simple question, relating to the default 'home' directory when an app writes to the internal memory. By default, any files created are placed by the OS (2.2) in: /data/data/your.package/files When reading in files, the same default is used, when…
Paul Mennega
  • 10,049
  • 19
  • 67
  • 109
52
votes
6 answers

How do I find a user's home directory in Perl?

I need to check whether a file in a user's home directory exists so use file check: if ( -e "~/foo.txt" ) { print "yes, it exists!" ; } Even though there is a file called foo.txt under the user's home directory, Perl always complains that there…
Haiyuan Zhang
  • 36,164
  • 38
  • 101
  • 131
31
votes
3 answers

How can I find the user's home dir in a cross platform manner, using C++?

How can I find the user's home directory in a cross platform manner in C++? i.e. /home/user in Linux, C:\Users\user\ on Windows Vista, C:\Documents And Settings\user\ on Windows XP, and whatever it is that Macs use. (I think it's…
Macha
  • 13,228
  • 14
  • 54
  • 68
24
votes
5 answers

How to change home directory of Jenkins?

Simple question: How to change the jenkins home directory location? By default it points to /var/lib/jenkins whereas I want it to point to /home/jenkins. I have changed my $JENKINS_HOME to /home/jenkins but it doesn't help me.
user1728119
  • 357
  • 1
  • 4
  • 12
20
votes
2 answers

Fix msysGit Portable $HOME location

I have successfully installed and configured msysGit Portable on my flash drive, and have used it to pull and push GitHub repos. However, I seem to always have to kludge the SSH support. Specifically, in order for SSH to find my key files, I have to…
dgw
  • 476
  • 1
  • 3
  • 16
14
votes
7 answers

How to modify ~/.ssh folder & files in windows?

I feel like I am missing some fundamental concept as to how the .ssh directory works in windows. I have had no issues when working in OSX/Linux like I am having now. My end goal is simply to move my existing ssh key into the default ~/.ssh…
u353
  • 850
  • 2
  • 8
  • 16
13
votes
1 answer

Expand tilde in Rust Path idiomatically

Sometimes, for instance when reading some configuration file, you read a file path entered by the user without going through the shell (for instance, you get ~/test). As Option 2 below doesn’t write to test file in user home directory, I’m wondering…
Clément Joly
  • 495
  • 6
  • 18
1
2 3
11 12