If a pathname begins with ~, it will be searched for in the home directory. Subsequent tildes in the pathname will be construed as literal tilde path or filenames and will not be treated specially. To access a filename named ~, you must construct a path to reference the filename, even if it's within the current directory such as ./~.