Tag Info

Hot answers tagged

642

Quoting Wikipedia: On Unix-like operating systems (including BSD, GNU/Linux and Mac OS X), tilde often indicates the current user's home directory: for example, if the current user's home directory is /home/bloggsj, then cd, cd ~, cd /home/bloggsj or cd $HOME are equivalent. This practice derives from the Lear-Siegler ADM-3A terminal in common ...


16

The tilde ~ is interpreted by your shell. Your shell will interpret ~ as a short form of $HOME. Try (echo ~; HOME=foo; echo ~). This should first print your real home directory and afterwards "foo", as you set $HOME to that. The default value of $HOME comes from you system configuration. Use getent passwd to list all known users and their home directories. ...


15

This change was introduced by BSD after 1985 (BSD 4.2 was still documenting /usr) and in or before 1988 (BSD 4.3/SunOS 4.1 hier(7) manual page already documents /home). It was quickly followed by Solaris 2.0 (which kind of merged System V and BSD) and was later adopted by most other Unix vendors. This is from the Solaris 2.0 useradd manual page: -D ...


14

~foo means 'the home directory of user foo'. This isnt done by the kernel, its interpreted by the shell. Whenever the shell sees ~foo as an argument, it transparently replaces it with the home directory of user foo and passes that in its place. So when you run cd ~tandu, the shell is actually running cd /home/tandu.


12

~ is an alias for $HOME provided by a number of shells, but $HOME is more universal. $HOME actually asks the shell to insert (substitute) the environmental variable HOME here. There are quite a number of different environmental variable that can be substituted, try running env for a list. Note that ~ is not always recognized when it's not at the beginning ...


12

Because those applications that place configuration files in $HOME are ignoring the XDG Base Directory Specification, notably: There is a single base directory relative to which user-specific configuration files should be written. This directory is defined by the environment variable $XDG_CONFIG_HOME... If $XDG_CONFIG_HOME is either not set or empty, a ...


12

One day you're going to change your computer, or to give someone else (a family member, for example) an account on your computer. If you want to keep a setting on your next computer, put it in your home directory. If the other person might want a different setting, put it in your home directory. If the setting is computer-dependent and not user-dependent, ...


11

A user's home directory is the initial directory when a user logs in. Normally the user may create files and directories only in in home directory (apart from temporary directories). Also various settings (user specific startup files and such) are usually stored in the user's home directory. Server is just annother name for a host (a computer). Think of a ...


10

Inkscape, being a GTK application, uses the GLib g_get_home_dir function to find the user's home directory. As documented in that link, g_get_home_dir does not consult $HOME, but rather /etc/passwd. You'd have to patch Inkscape to check $HOME first (as shown in that link).


9

The ~ can be used for more then just that. Any command can profit from having a short-cut to the home folder. So it is not necessary if you want to cd into your home, but what about ~/.config ? $ cd ~/.config Otherwise you'd have to write out the home path, use the $HOME var or do two cds. Also for copying or moving files: $ cp ~/downloads/some-file ...


8

That line in your .profile should be one of export PATH="$PATH:$HOME/Unix/homebrew/bin" PATH="$PATH:$HOME/Unix/homebrew/bin" PATH=$PATH:$HOME/Unix/homebrew/bin PATH=$PATH:~/Unix/homebrew/bin The ~ character is only expanded to your home directory when it's the first character of a word and it's unquoted. In what you wrote, the ~ is between double quotes ...


8

I wouldn't want my entire home directory checked into version control simply because it means every subdirectory I go into would have the version-control context of my home dir. Commands like git checkout would have an actual action in that case, causing issues if I accidentally run something from the wrong directory, whether that something is git itself or ...


8

The value that is used for ~ is determined from the value you get from the administrative database (getent passwd), typically in the /etc/passwd file, for each user's home directory that's defined there. $ cat /etc/passwd root:x:0:0:root:/root:/bin/bash sam:x:500:500:Sam Mingolelli:/home/sam:/bin/bash tracy:x:501:501::/home/tracy:/bin/bash The 6th column ...


7

Yes, but not advisable (as FAT doesn't support permissions). There are a couple of options you could consider: install the ext2 Windows driver mount the FAT partition inside /home/$USER/<mount-dir> Either way the drive will be accessible by both systems.


7

While they are quite reliable (no moving parts), SD cards/USB flash drives can be slower (you probably do not want to run disk-intensive operations from there) and have limited write cycles. From this Super User question: Flash memory indeed has limited write cycles. However, by now it is unlikely that you'll encounter this within the normal lifetime of ...


6

Yes, there is at least one major pitfall when considering git to manage a home directory that is not a concern with subversion. Git is both greedy and recursive by default. Subversion will naively ignore anything it doesn't know about and it stops processing folders either up or down from your checkout when it reaches one that it doesn't know about (or ...


6

I do this and it works just fine for me. But I only use it on one computer; the biggest problem I see with using the same card for two means you can only use one at a time. Just something to watch out for: I ran into a bit of trouble because the system was trying to mount the /home directory before the SD card was detected, aborting the boot process. I had ...


6

The .config directory is a newish development courtesy of XDG that seems, deservedly, to have won favour. Personally, I don't mind a dot directory of your own. A bunch of separate dot files (ala bash and various old school tools) in the toplevel of $HOME is a bit silly. Choosing a single dot file is a bad idea, because if in the future you realize maybe ...


6

You need to quote it to protect it from shell expansion. ls ~ # list your home directory ls "~" # list the directory named ~ ls \~ # list the directory named ~ Same thing with rm, rmdir, etc. The shell changes ~ to /home/greg before passing it to the commands, unless you quote or escape it. You can see this with echo: anthony@Zia:~$ echo ~ ...


5

As Noufal Ibrahim says, I think this is a Solaris convention. IIRC, /export/home is used on the server where the actual files live, and /home is where the other servers mount it. What does mount | grep home say? I'm guessing that /export/home has a file system type of UFS, and /home has a type of NFS? /etc/fstab may also have some clues.


5

You probably won't be able to manually un-mount devices that contain root and/or home filesystems: too many processes will have one or the other as their current working directory. So that can't be your situation. Disadvantages: Requires root to mount or unmount. Easy to forget to do, causing extra puzzlement. Advantages: A disk un-mounted when a ...


5

A complement to jasonwryan's great answer, addressing some of your issues: Your $XDG_CONFIG_HOME is not set to ~/. It simply isn't set. So applications that follow the XDG Speciifcation use the default ~/.config The dirs inside /.config are not hidden because they don't have to. The whole point of using a ~/.config dir is to un-clutter the user's $HOME. ...


5

You should be able to log in as root, because usually a percentage of the partition's size is reserved in order to always enable root login for rescue operations and such. See this U&L Q&A: Reserved space for root on a filesystem - why? What you won't be able to do, however, is log in as a regular user from your display manager then switch to root ...


4

I assume that your gateway device to the internet does NAT (network address translation), i.e. your home network uses for example a private network like 192.168.0.* and you dynamically get one IP from your ISP which is used by the gateway. In that case someone on the internet only is able to access port 80 on your home network web-server, when you have ...


4

Yes, the home directory of the current user should be whatever the environment variable HOME indicates. There is, of course, a global system setting: the entry in /etc/passwd, or more generally the home field in the user database. Applications are supposed to use that setting only to look up a user other than the current user, or if there are security ...


4

If you just want to disable it: update-rc.d -f gdm remove If you want to remove it: apt-get remove gdm You only have to address the gdm package to keep X from starting. And yes, it is perfectly safe. Also, depending on what version of Debian your CrunchBang server is based off of, you may be dealing with gdm3. If so, just replace gdm with gdm3 in ...


4

I've tried both, and preferred the symlink approach in the end: Check out to wherever make install Log out and in again to load the X settings Disadvantages: Have to move files to the repo before adding them Have to maintain the list of symbolic links in the Makefile Advantages: No need for a massive .gitignore (I have 133 dotfiles in ~ on my ...


4

I've ran an entire system from an SD card before (over USB 1.0!) It was extremely slow. I was running OpenBSD. It has softdep which increased performance by a large amount, though that doesn't transfer to Linux. I'd say the biggest thing to make sure of is that you mount it with noatime, this way, you don't get penalized by every read you do. Also, you ...


4

As for the tutorial, search engines seem to work, e.g. this one on howtoforge.com seems to give reasonable hints. Generally you might want to reconsider what exactly you are trying to achieve in the end. While eCryptfs will (to some degree) guarantee confidentiality you should be aware of several things: to hide the contents of home directory from other ...


4

A user's BASH environment variables can be defined in ~/.profile. Add a line to this file: export PATH=$PATH:~/bin To read the new PATH variable now: . ~/.profile or source ~/.profile (The . and source are synonyms.) Then to see that the PATH variable was updated: echo $PATH Update I have never seen {} in a PATH environment variable? ...



Only top voted, non community-wiki answers of a minimum length are eligible