Looking at your instructor's and friends' files

University of Wisconsin Madison

Computer Systems Lab CS1000

Wiscinfo
Wiscinfo
CS Home
CS Home
CSL
CSL
Feedback
CS1000
Feedback
Feedback

next up previous contents index
Next: File Management Up: The File System Previous: Navigating the tree

Looking at your instructor's and friends' files

   

So that you don't have to know the complete path of someone's home directory, the C shell provides a shorthand for getting to people's home directories: the ~ (tilde) character. Precede a user's login name with the ~ character and the shell will expand it to the complete path name. In the special case where you do not give a login name after the ~ , the shell will expand it to your home directory, making cd ~ equivalent to cd.

vega1%cd ~cs412-1 cd to cs412-1's directory
vega1%ls
public   private
vega1%cd private try to look at a protected directory
vega1%pwd
/p/course/cs412-1
vega1%cd ~/private cd to your own private directory
vega1%pwd
/u/b/o/bob/private
vega1%ls
cs412   mbox   cs367
vega1%cd ~betty cd to betty's home directory
vega1%pwd
/u/b/e/betty

Please note that even though you can list the contents of someone's home directory, you cannot access all these files. Contents of files are protected under the distributed file system, AFS. See chapter 5 for more information.



Caitlin Howell
Thu Jan 16 20:24:40 CST 1997