Directory Image
This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Privacy Policy.

Python Course For Beginners | Command Line Lecture

Author: Manoj Singh Rathore
by Manoj Singh Rathore
Posted: Apr 21, 2019

Hey everyone welcomes to this crash python course lecture on using your command line.

Before we install anything including python, it's essential to have a rapid overview of how to work your command line and the command line allows you to move programmatically through your computer's directories.

That way you can run Python scripts at your command line.

We're going to cover in this short lecture is how to find your current directory how to list all the files in at the rectory how to change the directory and how to clear the command line screen.

Something you need to understand though is that the commands are going to be slightly different depending on what your operating system is.

So for Mac OS and Linux users go ahead and jump to this time in the video to go through your instructions if you're a Windows user go ahead and jump to this time stamp at the video to jump to your specific instructions.

Moreover, then once you've gone through your command line crash course go ahead and move on to the next lecture.

Again this is just because the commands are slightly different for Linux and Mac OS users versus Windows users. OK.

Go ahead and jump to the correct time stamp and we'll meet back there. All right.

So let's go over the windows command line operations at your computer to find the command prompt.

All you need to do is search for the term CMD.

Moreover, we should be able to find command prompt as the best match if the command prompt doesn't show up when you search CMD.

Instead, search for the whole phrase command prompt and then you should see the command prompt Desktop app.

Once you've opened up your command prompt, you should see something that looks like this.

Let's start by finding out where are we currently located.

Basically, what's our current directory.

I can use the command line to interact on my computer but to perform those interactions I need to know where I am at on my computer.

You can think of this as basically programmatically moving around through files and folders on your computer.

You can type out CD enter, and this will report back your current directory.

Now you'll notice the command prompt gives you the file path over you already are.

However, sometimes it's a file path is long or you're dealing with more complex things like virtual environments or installations.

It's always a good idea to check your current directory by typing CD.

Sometimes things like the Anaconda prompt will have other directories in parentheses.

You can always confirm your current directory by typing a CD enter and that reports back where you are.

So I can see right now I'm under this particular user's folder.

If I wanted to figure out where all the files and folders located in my current directory were or are I can type. D I r. Hit enter.

Moreover, that reports back the contents of my directory.

I can see here that there is a desktop documents downloads as well as some hidden files denoted by starting with a dot.

However, this is everything that's in this folder.

See users, Marcio, I can scroll down CCSB files pictures.

Now let's imagine I wanted to move into one of these subfolders.

What I can do is type CD and then the name of that folder.

For example, if I wanted to change directories to my desktop location, I could type a CD change directory

space and the desktop hit enter, and now I'm at my desktop, and I can type CD to confirm that I'm at my desktop if I want to go back up that victory.

All I need to do is type see the space dot or period to enter, and I've moved back up a directory.

Now you don't need to type in the entire file path.

If you're moving around what you can do say CD begin typing such as the letter D then hit tab.

You should be able to see autocomplete for you.

So as I hit tab, I get the various options of everything that starts with a capital D so I can go to

documents enter and then if I wanted to see all my documents I can type d r. Now we can see all our documents here.

Again if I want to go back see the space thought and if I ever want to clear my entire command line.

the screen I can type CLX and I've cleared the entire screen. All right.

That's all the basics we need to know for right now.

To review CD for current directory Diyar to list everything in my directory CD and then the name of the folder that I want to jump to.

For example, if I want to go to downloads CD downloads again, you can hit tab to autocomplete And if we ever want to jump back up CD.

However, if we ever want to clear the screen, it's seamless.

That's the basics you need to know.

We'll see you at the next lesson where we discuss how to install Python.

All right so let's go over the Mac OS and Linux command line operations and your command line in Mac. OS and Linux are known as a terminal.

So these commands work on both of these operating systems the same way.

Let's get started is to begin working off the command line on a Linux or Mac OS.

You first need to open up your terminal search your computer for terminal your Mac OS or Linux.

It's called the same thing and then open up your terminal.

You should eventually get something that looks like this.

The colors or fonts may be slightly different, but the basic idea is the same.

The terminal gives you a command line interface, and the command line interface allows you to move around

different files or folders on your computer and with some more advanced functionality you can also make new directories or remove directories.

We don't need to know that right now.

All we need to know is how to understand what our current working directory is changed directories. moreover, move around.

This allows us to move around the computer at the command line.

The first thing we want to know is where we're currently located to know that type PWT enter and this. Will print your working directory.

This is where you're currently located at the command line if you want to understand what files and

folders are located at your current location type L S and then enter, and you should see a list of different

files and folders at your current directory.

If you ever want to move to one of those files or folders where you can do is type CD and then whichever

file or folder you want to go to however it should be in the list that was just printed.

For example, let's move to our desktop so I will come back down here and type see the desktop enter.

Moreover, now if I type PWT, I hit enter again I'm now at my desktop.

If you ever want to clear your screen type clear enter, and now you've been able to clear your command line.

If you ever want to go back up a victory, it should see the space thought hit enter, and now we're back.

up a directory which I can confirm by typing P.W.

That's all we need to know.

As far as the commands are concerned to let's have a quick review to print your working directory.

It's PWT and this report's back.

We are currently located.

If you want to know the files and folders at your current location.

Type ls and this will list all the files and folders if you want to clear your command screen type clear.

enter.

This will clear your command line if you want to change directory to a subfolder type CD and then you.

can even begin typing the names such as the desktop.

Moreover, if I desk and then hit tab, it should autocomplete.

If you do not get an autocomplete by hitting the tab that's probably a good indicator that it's not a direct

subfolder of your current directory but then you can type CD.

The name of the subfolder is subdirectory, and then we can see how we're located here by taping PWT.

If you ever want to go back up type CD space thought OK that's the basics of moving around through the

command line.

We're going to be using that later on when we run Python scripts at the command line.

We'll see you at the next lesson of Techstack where we discuss how to install Python onto your computer.

About the Author

My name is Manoj Singh Rathore. I am working as a digital marketing head in Techstack.

Rate this Article
Leave a Comment
Author Thumbnail
I Agree:
Comment 
Pictures
  • Guest  -  2 months ago

    You know those cool dance moves everyone's doing on Reels? Well, trends aren't just for dance floors; they're on social media, too! Check out Instagram, Pinterest, and Behance for design inspiration. Colors, funky layouts, and cool navigation tricks – social media's got the scoop, and your website can totally rock it. Ultimate Branding eBook

  • Guest  -  2 months ago

    Word mark logos are exclusively text-based and display the company's name in a stylized font. They are excellent for businesses with a distinctive name that's easily recognizable, like Coca-Cola or Google. The design often incorporates custom fonts and unique lettering, making the company's name the primary focus. Logo design Services

  • Guest  -  2 months ago

    Welcome to Spin & Spark, where creativity knows no bounds! Immerse yourself in a world where innovation and design expertise converge to create extraordinary experiences. As the one-stop creative destination, we don’t just craft visuals; we curate moments that leave a lasting impression. Spin and Spark

  • Guest  -  2 months ago

    Welcome to Spin & Spark, where creativity knows no bounds! Immerse yourself in a world where innovation and design expertise converge to create extraordinary experiences. As the one-stop creative destination, we don’t just craft visuals; we curate moments that leave a lasting impression. Spin and Spark

  • Guest  -  2 months ago

    In the world of branding and marketing, a logo is the face of a company. It's the visual representation that quickly conveys the identity of a brand to the audience. Different types of logos exist, and each has its unique characteristics. In this comprehensive guide, we'll delve into the various logo types to help you understand which one best suits your business. Branding Design Services

  • Guest  -  2 months ago

    Very Good And Useful information Thank For Sharing if you want join - Online Programming Classes visit Vcare Technical Institute.

  • Guest  -  3 months ago

    After looking over a number of the blog posts on your website, I honestly appreciate your technique of writing a blog. I saved as a favorite it to my bookmark webpage list and will be checking back in the near future. Take a look at my web site as well and let me know your opinion. Web Designing Training in Bangalore Web Designing Course in Bangalore Front End Development Training in Bangalore Front End Development Course in Bangalore Web development training in Bangalore Web development course in Bangalore Full stack developer training in Bangalore Full stack developer course in Bangalore

  • Guest  -  1 year ago

    Very good write-up. I certainly love this website. Thanks! Web Designing Course in Bangalore Web Designing Training in Bangalore Web Design Training institute in Bangalore Full Stack Training in Bangalore Full Stack Training in Marathahalli Best Training Institute in Bangalore PHP Training in Bangalore PHP Course in Bangalore PHP Mysql Training in Bangalore PHP Mysql Course Online ReactJS Training in Bangalore Top 50 Interview Questions and Answers

  • Guest  -  1 year ago

    You ought to be a part of a contest for one of the finest sites on the internet. Web Designing Course in Bangalore Web Designing Training in Bangalore Web Design Training institute in Bangalore Full Stack Training in Bangalore Full Stack Training in Marathahalli Best Training Institute in Bangalore PHP Training in Bangalore PHP Course in Bangalore PHP Mysql Training in Bangalore PHP Mysql Course Online ReactJS Training in Bangalore

  • Guest  -  1 year ago

    Hello there! I just want to offer you a big thumbs up for your great info you have right here on this post Web Designing Course in Bangalore Web Designing Training in Bangalore Web Design Training institute in Bangalore Full Stack Training in Bangalore Full Stack Training in Marathahalli Best Training Institute in Bangalore PHP Training in Bangalore PHP Course in Bangalore PHP Mysql Training in Bangalore PHP Mysql Course Online

Author: Manoj Singh Rathore

Manoj Singh Rathore

Member since: Apr 07, 2019
Published articles: 4

Related Articles