Break the ice

When I first start reading Learn Python the Hard Way,I feel so confused about the "terminal" concept and those quirky command lines.Why on the earth should I grasp these trivia before I dive into the magnificent Python ocean? As it turned out,these basic commands run through your whole programming process.Using them is like directly talking to your computer,asking it to read files,go back to the most recent folder and do other colorful things.Just type a few letters and it's done!The reason it seems daunting is because I'm so "spoiled" by the drag-and-drop and double-click system.Well,take a deep breath,it's time to interact with your machine like a real programmer!

The Setup

There are many command line tools for different operation systems.On Windows you can use Powershell or Cygwin.

Yo computer,do this for me(for Windows)

  • pwd=print working directory=tell me where I am now
  • cd "folder name"=change directory=take me to another folder
  • cd ~=This is not where I wanna be.Beam me back to the original folder
  • ls/dir=list directory=show me what's in the current folder
  • mkdir=make a directory=create a new folder
  • touch=make an empty file
  • cp=copy a file
  • rm=removing a file
  • less/more=view a file(待修改:打开包括中文的.md文件时用more会出现乱码,但是打开含中文的.txt文件时用less会出现乱码)
  • exit=well,exit

Some useful tips

References

Learn Python the Hard Way