A guide to command line

Eftee Codes
2 min readDec 28, 2021

Whether you are just starting off on your journey as a coder or are an experienced professional, this guide will help you understand the basic important commands in CMD to start with and always aid as a cheat-sheet anytime you want to revise! :)

So, what is command line?

In simple words, it’s a way to communicate with your computer, but instead of the mouse or touchscreen (in some), we use ‘commands’.

Today let’s cover a few important commands here, like:

cal, cd, cp, date, df, file, free, help, less, ls, mkdir, mv, pwd, rm, unzip, wget, 

Lets get right into it.

  1. $ cal
    displays the calendar of the current month.
  2. $ cd
    helps you change directory.
  3. $ cp
    * $ cp <itemOne> <itemTwo> copies file/directory ‘itemOne’ to file/directory ‘itemTwo’.
    * $ cp fileOne fileTwo directoryOnecopies ‘fileOne’ and ‘fileTwo’ into ‘directoryOne’.
    $ cp directoryOne/* directoryTwocopies all files from ‘directoryOne’ into ‘directoryTwo’.
    $ cp -r directoryOne directoryTwocopies the content of ‘directoryOne’ into ‘directoryTwo’.
  4. $ date
    displays the current date and time.
  5. $ df
    helps you check the current amount of free disk space on our drive.
  6. $ file <fileName>
    helps you check the file type.
  7. $ free
    helps you check the amount of free memory.
  8. $ help
    use this command when you’re not sure of which command you want to use or when you want to review the information about shell built-in commands.
  9. $ less <fileOne>
    displayes content of ‘fileOne’.
  10. $ ls list files.
  11. $ mkdir
    *$ mkdir <directoryName> create directory by the name ‘directoryName’.
    *$ mkdir <directoryOne> <directoryTwo> <directoryThree>create multiple files.
  12. $ mv
    *$ mv <itemOne> <itemTwo> helps move and rename a file.
    *$ mv fileOne fileTwo Move ‘fileOne’ to ‘fileTwo’.
    Note: If ‘fileOne’ exists, it is overwritten with the content of fileOne, if not, fileTwo is created.
    *$ mv fileOne fileTwo directoryOneMove ‘fileOne’ and ‘fileTwo’ into ‘directoryOne’.
    Note: ‘directoryOne’ must already be an existing directory.
    *$ mv directoryOne directoryTwoMove ‘directoryOne’ and it’s content into ‘directoryTwo’.
    Note: If ‘directoryTwo’ does not exist, it is created, the content is moved to ‘directoryTwo’, and ‘directoryOne’ is deleted.
  13. $ pwd
    ‘print working directory’ / displays your working directory.
  14. $ rm
    *$ rm <itemOne> removes/deletes itemOne.
    IMPORTANT: Once you delete something with rm, it’s gone!
    *$ rm -r directoryOnedeletes ‘directoryOne’ and it’s content(s).
    *$ rm -r fileOne directoryOne deletes ‘fileOne’ and ‘directoryOne’ and it’s content(s).
  15. $ unzip command to unzip a file.
  16. $ wget <location>command-line program for file downloading.

Thank you for reading.

Happy coding!

--

--

Eftee Codes

Full Stack Developer | A tech, psychology and economics geek 😄