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

Other's Files

So that you don't have to type the complete path of someone's home directory, the 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.

[bbadger@demo01] (1)$ cd ~cs367-1 cd to cs367-1's directory.
[bbadger@demo01] (1)$ ls  
public/ private/  
[bbadger@demo01] (1)$ cd private try to look at a protected directory
private: Permission denied  
[bbadger@demo01] (1)$ pwd  
/afs/cs.wisc.edu/p/course/cs367-1 still in this directory
[bbadger@demo01] (1)$ cd ~/private cd to your own private directory
[bbadger@demo01] (1)$ pwd  
/afs/cs.wisc.edu/u/b/b/bbadger/private  
[bbadger@demo01] (1)$ cd ~bucky cd to bucky's home directory
[bbadger@demo01] (1)$ pwd  
/afs/cs.wisc.edu/u/b/u/bucky  

Please note that even though you can list the contents of someone's home directory, you cannot always access all these files. Files are protected using AFS and Unix permissions. See chapter [*], Advanced Topics, for more information.


next up previous contents
Next: File Management Up: The File System Previous: Navigating the File System   Contents
Michelle Craft 2008-01-23