top of page

A Guide to the Linux Command Line

Introduction


Aside from eliminating the need to drag your mouse to click on new file or copy a directory (and appealing to our laziness), Linux commands can often perform extremely useful tasks along with making our lives a little easier.


Take a look at these common command-line utilities to help you navigate your IDE efficiently.


Common Commands


  • mkdir [directory name]

    • make directory

    • creates a new directory with specified name


  • cd [directory]

    • change directory

      • "cd ." moves you to the current directory

      • "cd .." moves you to the previous directory

    • "moves you into" specified directory

    • pwd (present working directory)

      • writes the file path to current directory


  • code [file]

    • creates a file with specified extension (.py, .c, .txt)

    • *Only works in VSCode if installed


  • ls (list)

    • lists all files / child directories within a directory


  • cp [file] [destination]

    • copy

    • cp -r [original directory] [destination]

      • -r allows for an entire directory to be copied


  • rm [file]

    • remove

    • deletes a file + asks for confirmation

    • rm -f [file]

      • -f "forces" through confirmation to delete file

    • rm -r [directory]

      • -r "recursively" deletes a directory

    • rm -rf [directory]

      • -rf "forces" through confirmation to delete directory


  • mv [original file / directory] [destination]

    • move

    • transfers a file or directory into a different directory


  • clear / CTRL + L

    • clears terminal of all past commands


*mv bug occurred because I was in directory2


Final Thoughts


Hopefully this guide has shed a bit of light on how to use the command line to speed up tasks in your own programming environment.


Thanks for reading!

Comments


bottom of page