Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dayu Zhang 9/8/2014 Lab02. Example of Commands pwd --- show your current directory This is home of venus, not your home directory Tilde: means you are.

Similar presentations


Presentation on theme: "Dayu Zhang 9/8/2014 Lab02. Example of Commands pwd --- show your current directory This is home of venus, not your home directory Tilde: means you are."— Presentation transcript:

1 Dayu Zhang 9/8/2014 Lab02

2 Example of Commands pwd --- show your current directory This is home of venus, not your home directory Tilde: means you are in your home directory Account dzhang’s home directory

3 Example of Commands If you move up beyond your home directory, you may not have permission to view the files.

4 If you see something like this, one reason might be that you are trying to vi a file beyond your home directory To fix this, press q (for Quit)

5 Example of Commands mkdir dirname --- make a new directory dirname cd dirname --- change directory to dirname ls --- list your files in current directory

6 cd --- go to your home directory cd.. --- move up one directory in the hierarchy This is your home directory Example of Commands

7 Example of Hello.cpp Create file Hello.cpp using command “touch” Then use command “vi” to edit Hello.cpp

8 Command Mode To switch from Command Mode to Insert Mode, press i

9 Insert Mode To switch from Insert Mode to Command Mode, press ESC

10 Write the program in Insert Mode

11 Go to Command Mode, then save the program using “:wq” :wq This is

12 vi Editor in Command Mode: :wq --- save the file and quit vi :q --- quit vi when the file has not been modified :q! --- disregard any modification and quit vi

13 Compile Hello.cpp Compile Command is “g++” If you get an error here, it means there is something wrong with your code. You should go back to check your code using “vi Hello.cpp” You should see this

14 Run Program Run Command is “./a.out”

15 Example of SSH Secure File Transfer Client Desktop Icon

16 Log in to venus.cs.qc.cuny.edu Left Pane: LocalRight Pane: Venus

17 Upload and Download Files Log in to venus.cs.qc.cuny.edu To upload a file from your Windows pc to Venus, drag the file from the left pane to the right pane To download a file from Venus to your Windows pc, drag the file from the right pane to the left pane

18 More Command Examples rm -r dirname --- removes the directory dirname and all files in it rmdir dirname --- removes an empty directory dirname

19 More Command Examples cp --- copy a file e.g. to copy file Hello.cpp to directory folder1

20 More Command Examples cp -r --- copy all files in a directory e.g. to copy all the files in directory folder1 to directory folder2 exit --- to exit Venus

21 If You Use Mac No need to download SSH Secure Shell Client Go to Terminal Login in to Venus using “ssh”

22 Mac – File Upload and Download Upload a file upload.txt from Mac desktop to Venus account directory CS111 Download a file Hello.cpp from Venus account directory CS111 to Mac desktop


Download ppt "Dayu Zhang 9/8/2014 Lab02. Example of Commands pwd --- show your current directory This is home of venus, not your home directory Tilde: means you are."

Similar presentations


Ads by Google