常用终端命令

Windows Commands

These are commands that may be used in the default command interpreter, cmd.exe, as well as Powershell.

  • cd - display current directory. Short for “change directory”.
  • cd .. - move up the directory tree one level. Doing this from C:\Users\JohnSmith\Desktop will take you to C:\Users\JohnSmith, for example.
  • cd \ - brings you back to the root of the current drive
  • cls - Clear the screen
  • X: - takes you to the last used location on drive X (typically, use C: or D:). It defaults to the root directory if you have not previously cd’d to anywhere on that drive.

Mac & GNU/Linux Commands

These are commands that may be used in a common command interpreter, bash, which is installed by default on most Mac or GNU/Linux systems, but may not apply 100% in other command shells, such as fish, or zsh for instance.

  • pwd - short for “print working directory.” Displays the directory you are currently in.
  • cd - a quick change directory back to $HOME directory. Short for “change directory”.
  • cd .. - move up the directory tree one level. Doing this from /home/johnsmith/Desktop will take you to /home/johnsmith, for example.
  • cd / - brings you back to the root of the current drive
  • ls - Display a list of files and folders, very fast.
  • ls -l - Displays a detailed list of files and folders.
  • clear - Clear the screen

Python commands

  • quit() or ctrl + Z or exit() -ends Python on Windows.
  • quit() or ctrl + D -Tells “End Of File” to Python on Mac and GNU/Linux.
  • quit() or ctrl + C -Kills Python process on Mac and GNU/Linux.

参考链接

Pythonlearn:resources-week01

文章目录
  1. 1. Windows Commands
  2. 2. Mac & GNU/Linux Commands
  3. 3. Python commands
  4. 4. 参考链接
,