Hello Command-Line 👋 : An Introduction

Introduction to Command Line

1. What is Command-Line?

2. Why should I learn Command-Line?

3. How to use Command-line?

  1. Click on the Start button.
  2. Go to the Windows System.
  3. Open Command Prompt.
  1. pwd -This command returns the name of present working directory.
    Syntax : pwd
  2. mkdir -This command is used to create a directory/folder.
    Syntax : mkdir directory_name
  3. touch -This command is used to create a file.
    Syntax : touch file_name
  4. cd -This command is used to change directory (folder) in the file system. It represents the current directory.
    Syntax : cd pathname
  5. cd .. -This command is used to move one level up (one folder) in the file system.
    Syntax : cd ..
  6. ls -This command is used to list the directory (folder) system.
    Syntax : ls
  7. cp -This command is used to copy the contents of one file to another file.
    Syntax : cp file_to_copy new_file_name
  8. mv -This command is used to move a file to another folder and rename a file.
    Syntax : mv file_to_move destination_directory
    mv old_file_name new_file_name
  9. rm -This command is used to remove a file or a directory (folder).
    Syntax : rm file_name
    rm -r directory_to_remove
  10. cat -This command is used to display the content of a file.
    Syntax : cat file_name
  11. clear -This command is used to clear the CLI window.
    Syntax : clear
  12. exit -This command is used to exit the CLI window.
    Syntax : exit
  • up arrow key → will bring up the last command that was executed.
  • history → will print out a list of the previous commands executed.
  • tab key → pressing the tab key can be used to auto-complete the directory and file names while typing paths or filenames.
Time to test your knowledge



Tech Enthusiast | MAIT’23

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store