replace ~ with value of HOME variable