Project 1 Example Output


The following presents a session in 61C-FS.  Annotations have been added to explain behavior.
Be sure to view this page in a maximized window.  Whitespace is important.

Also note that softlink directories may be a bit nonintuitive.  Understand that example carefully.

> create dan                    Create a file named "dan"
garcia                       
When two consecutive carriage returns (ENTER) are inputted,
                              the file is saved and the user is returned to the prompt.
> cat scott                     Does't exist
cat: scott: No such file or directory.
> cat dan                        
View file named "dan"
garcia
> append dan                    
Write more content to "dan" file
 teaches cs61c

> cat dan
garcia
 teaches cs61c
> ls                           
Show directory
-rw dan
> setread 0 dan                 
Prevent reading of "dan"
> ls
--w dan
> cat dan
cat: dan: Operation not permitted.
> ln dan lecturer               
Remember, soft links must be absolute
ln: dan: Soft link targets must be absolute
> ln /dan lecturer                
Generate the softlink
> ls                                Files must be listed in alphabetical order.
--w dan
--w lecturer -> /dan            
Note how the softlink shows the properties of its target
> setread 1 lecturer            And performing some commands on the softlink modifies the actual file
> ls
-rw dan
-rw lecturer -> /dan
> pwd                        
What directory are we in?
/
> mkdir TA                   
Make a new directory named TA
> cd TA                        Enter it
> mkdir aaron
> cd Aaron                    
All filenames are case-sensitive
cd: Aaron: No such file or directory.
> cd aaron
> ln /TA TAReturn           
Create softlink to /TA
> ls
drw TAReturn -> /TA
> cd TAReturn
> ls
drw aaron
> cd aaron
> pwd
/TA/aaron/TAReturn/aaron   
Note how the softlink names show within the pwd
> cd ..
> ls
drw aaron
> pwd
/TA/aaron/TAReturn       
Note how cd .. simply removed the suffix of the last pwd
> cd ..
> pwd                    
Again
/TA/aaron
> cd /                    
Go to root
> pwd
/
> ln /TA/aaron cs61cTC   
Another demo of softlinks
> ls                    
drw TA                    Note how the files are alphabatized. CAPITALS come before lowercase
drw cs61cTC -> /TA/aaron
-rw dan
-rw lecturer -> /dan
> cd cs61cTC
> create discussion
Today we learn about...

> ls
drw TAReturn -> /TA
-rw discussion
> cd ..
> ls
drw TA
drw cs61cTC -> /TA/aaron
-rw dan
-rw lecturer -> /dan
> cd TA/aaon           
"aaon" doesn't exist within TA
cd: aaon: No such file or directory.
> cd TA/aaron
> ls
drw TAReturn -> /TA
-rw discussion
> mv discussion TAReturn   
Without the ending "/" mv interprets the destination as a file name.
mv: TAReturn: File already exists
> mv discussion TAReturn/  
This moves the file
> pwd
/TA/aaron
> cd ..
> pwd
/TA
> ls
drw aaron
-rw discussion               
And here it is
> mv discussion discuss        Now rename the file
> ls di?                        
Demo of wildcards
ls: di?: No such file or directory.
> ls d?????s
-rw discuss
> ln /nothing link         
A nonexistant link  
> ls
drw aaron
-rw discuss
INV link -> /nothing    
INV stands for invalid
>



Below is an example of softlink Directories.


> cd /                   
Goto root directory
> mkdir dirA
> mkdir dirNonExistant/dirC           
Since dirNonExistant doesn't exist we can't create dirC
mkdir: dirNonExistant/dirC: No such file or directory.
> mkdir dirA/dirB                   
But since dirA does exist, this works
> mkdir dirA/dirB/dirC
> cd dirA
> pwd  
/dirA
> ln /dirA/dirB/dirC linkC           
Make the softlink
> ls
drw dirB
drw linkC -> /dirA/dirB/dirC
> cd dirB/dirC
> pwd                               
Where we are after the cd.
/dirA/dirB/dirC
> cd ..  
> pwd
/dirA/dirB                           
Note that cd .. popped one directory off of the previous working directory.
> cd ..
> pwd
/dirA
> cd linkC                           
Enter the softlink
> pwd                                   
We are now in the same directory as dirA/dirB/dirC 
/dirA/linkC                               but pwd displays dirA/linkC instead (shows link name)
> cd ..                               
> pwd                                   
And cd.. returns us to /dirA, NOT /dirA/dirB 
/dirA                                       
(It pops one directory off of the previous working directory.)