1 / 22

Lab02

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

laksha
Download Presentation

Lab02

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab02 Dayu Zhang 9/8/2014

  2. Example of Commands • pwd --- show your current directory Account dzhang’s home directory Tilde: means you are in your home directory This is home of venus, not your 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 • mkdirdirname --- make a new directory dirname • cd dirname --- change directory to dirname • ls --- list your files in current directory

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

  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” This is :wq

  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: Local Right 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 • rmdirdirname --- 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

More Related