z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Tilde notation

z/OS UNIX System Services User's Guide
SA23-2279-00

A ~ (tilde) can be used from the z/OS® shell in several forms:

Notation Meaning
~ Your home directory (that is, the directory given by your HOME environment variable). The command:
cp ~/file1 file2
copies file1 in your home directory into file2 in your working directory. This works regardless of what your working directory is.
cp file1 ~/dir
copies file1 from the working directory into dir in your home directory.
~ + The variable $PWD (which contains the name of your working directory).
~ – The variable $OLDPWD (which gives the name of the working directory you were in immediately before the last cd command).
~login name That user's home directory.

Example: To display the profile file of allane, from that user's home directory, issue:

cat ~allane/.profile
This is useful if there are a group of you working on a project and you have read-write access to some of each other's files.
Note: In the z/OS shell, your login name is your TSO/E user ID.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014