THE COMMAND LINE

    The command line is a powerful application on your computer that you can use to run programs, navigate through folders to manipulate files, and so much more. In this basic command line tutorial we will be going over three general ideas.

– Accessing the command line from Windows, Mac, or Linux

– A list of basic commands, what they do, and how you can use them effectively

– Tips and Tricks

ACCESSING THE COMMAND LINE

WINDOWS 10

There are a few easy ways to access the command line from Windows 10

1. Press Windows+X to open the Power Users menu, and then click “Command Prompt” or “Windows PowerShell.”

2. Another easy way is to use the windows search bar at the bottom left of your screen. Simply type in “Command Prompt” and it should pop up

3. Alternatively you can click on the start menu just to the left of the search bar and from there you can scroll through all the applications currently installed on your computer in alphabetical order. Find the command prompt or windows powershell, which is essentially the same thing, and click to open it.

Regardless of how you get there once you open the command line a screen will pop up that looks like this:

MAC

There are a couple of straightforward ways to open it up on Mac

1. Open the launchpad. It’s the silver icon in the Dock that looks like a rocket. The Dock is a panel of icons usually found at the bottom of the screen. You can alternatively open launchpad by pressing f4 on the keyboard. From there you need to click on the folder called “other”. Then you should see the application called “Terminal” Click on it to open the command prompt.

2. Click on the Spotlight Icon. It’s the magnifying glass at the top right corner of the screen. Type “terminal” into the search box and the terminal application should pop up, click on this to open the command prompt.

LINUX

The easiest way to access the command line on Linux is to hit CTRL+ALT+F1 to get to the powershell.

Once you get there you should see a screen that looks like this:

BASIC COMMANDS

THE CD COMMAND

The CD command takes a directory name as an argument and switches into that directory.

Typing the below text would switch you from whatever directory you are in now to your desktop directory. The directory must be within no more then one folder away from the one you are trying to navigate to otherwise you will get an error that says “the system cannot find the path specified” or something along those lines.

You can move to the directory that is directly above the current directory in the list by typing this: cd..

ls COMMAND

the ls command lists all files and directories in the current directory. Note that the ls command won’t work in a windows command prompt but will work in the Windows PowerShell.

Simply type ls and it will output all the files in a neatly ordered list. Obviously I cut the image off before the directory was listed but below where it says Directory: there will be a neatly ordered list.

THE pwd COMMAND

The pwd command merely prints the working directory. The working directory is listed under the word “Path”. This command also tends to work only in windows powershell instead of the command prompt.

TIPS AND TRICKS

COPY AND PASTE COMMAND LINE TEXT

There is a little trick that will allow you to copy and paste specific pieces of text from the command line.

First, right-click anywhere on the title bar and then select Properties.

Second, in the Options tab, check the box for “QuickEdit Mode” and then close the box.

Third, once you have this mode enabled you’ll be able to left click anywhere in the window and drag a box around the text you would like to select

Finally, you’ll be able to simply type ctrl + C which you are then free to paste wherever you need to.

    This is a very basic introductory tutorial for using the command prompt. Part 2 of this tutorial series will greatly expand upon what has been introduced here.