Tag Archives: Comnand Line

Why CLI or the Command Line Interface is a Techs friend? Part 3

Warning! Any computer manipulate in is done at your risk!

NOTE: The information shared in this applies to Windows 10, Windows 8.1 and Windows 7. Note that, for simplicity, we will use screenshots taken only in Windows 10

NOTE: Command Prompt is not case sensitive, meaning that commands can be typed with capital letters, lowercase or any combination of them. The commands CD, cd or Cd will all work in the same way.

OK so we have seen a few basics command now let’s rename a files and folder, copy files and folders, and Launch an application.

How to rename files and folders

OK so when we left off we had one folder with one file in the root of where we were working. So to see what we have I have used the tree command. This is fun on I will talk about later.

1

So let’s start by renaming the folder. By moving to the root of the folder in my case being H: and running the ren command. So I would Type: h: (Then Press Enter), then Type: ren x86_Root x86_Root_Ren (Then Press Enter). This would give me the below, notice I ran a dir to show he change.

2

So as you can see the folder x86_Root has been renamed. So know lets change the files name Hello.txt to Hello_Ren.txt So I Type: cd: x86_Root_Ren (Then Press Enter), Then Type: ren Hello.txt Hello_Ren.txt(Then Press Enter). I then run a dir command to see the change.

3

Copy files and folders

Now let’s do some copying first Type: cd .. (Then Press Enter), and then Type: cls (Then Press Enter) to clear the screen. So with this we will be using the copy command and the xcopy command. So for this I am going to make the x86_Copy folder I do this by Typing: md x86_Copy(Then Pressing Enter). You can use the information from part 2 for this step. What I am looking for is your working directory to look like the below.

4

So now let’s copy Hello_Ren.txt. So to do this you would use copy in the format of copy [drive letter]: [source folder] \ [source file] [destination folder] \ [destination file] so for me it would be
Type: copy h:\x86_Root_Ren\hello_Ren.txt h:\x86_Copy\Hello_Ren.txt (Then Press Enter).

5

As you can see I made a mistake in my first line of using h:\x86_Copy_Ren as my destination and it gave me an error. I thought it was good to show mistakes happen so don’t be intimidated. Now let’s copy a folder with xcopy.
So to do this you would use xcopy in the format of xcopy [drive letter]: [source folder] [destination folder] so for me it would be.
Type: xcopy h:\x86_Root_Ren h:\x86_Root_Xcopy (Then Press Enter).

6

As you can see I had to tell the computer I wanted to copy to a folder or Directory.

Launch an application from the Command Prompt

Now let’s run an application! You won’t do this much but it is nice to know so let’s look at a built in MS app we can play with. mspaint.exe is a good one, note there is a file with paths so that if you are trying to run an application that is not in a folder it will look in a path in this file. By default the folder associated with mspaint.exe is in this file so this is not the most accurate but it gets to the point.
So simple go to your CLI and enter the executable in.

In the command prompt I entered mspaint and the paint program started in my Windows.

So in the CLI or Command Prompt Type: mspaint (Then Press Enter).

7a

7b

So that is about it, I purposely left out deleting as this can be very catastrophic if not done correctly. So if it reaches this level get someone that knows to help. I would like to thank anyone that has viewed these and openly ask you to send any feedback to daryl.jiles@x86pcrepair.com. This being my first jump into this type of instruction I have a long way to go, but looking at my post you can see how I have changed and manipulated my format already. So I leave you with this, do what you love and if technology calls you don’t be afraid of it but embrace it. I have years of experience but would have never learned had I not experimented. So thanks everyone and Have a backup…. Have I said that yet?

So as I go I leave you with a tree image from the CLI.

8

 

-Daryl Jiles

Why CLI or the Command Line Interface is a Techs friend? Part 2

Warning! Any computer manipulate in is done at your risk!

NOTE: The information shared in this applies to Windows 10, Windows 8.1 and Windows 7. Note that, for simplicity, we will use screenshots taken only in Windows 10

NOTE: Command Prompt is not case sensitive, meaning that commands can be typed with capital letters, lowercase or any combination of them. The commands CD, cd or Cd will all work in the same way.

Command Prompt is not built only on advanced commands, but also on simple commands designed to perform basic operations. So don’t be afraid of it, just know you can have devastating issues if you are not careful. That said I learned one command at a time just as I want you to, so play a bit and have fun just be careful.

I am using a USB thumb drive marked as H:, but if you feel safe you could create a folder on your system drive usually C: So replace anything I enter as an H:  with a C: or the drive letter of your folder and you should be good.

So let’s start with making How to access a certain drive volumes. So depending on your system you could have any number or drive or volumes like on my PC I have 4 drives and 6 volumes. So you can look at a volume as a section of the hard drive allocated for use and assigned a drive letter.  But one most remember you can have unallocated volumes but that is another lesson.  So let’s say you are on C: and want to go to H: simply type in the drive letter: followed by enter. Like for me I would Type H: (Then Press Enter)

1

So as you can see by entering the command above I have moved to the drive I wanted. So let’s make some files and folders to view.
First let’s make a folder, you can name this anything but I am going with x86_Root. So to do this lets use the md or make directory command. Just say “md folder name” so I would Type: md x86_Root (Then Press Enter)

2

But wait how do I know it was made? That is where the dir command comes in. This is probably the one tool you will use the most in the CLI. dir shows a list of the directory structure of the folder you are in like in my example I was in the root of H:. So let’s see what we have by Typing: dir (Then Press Enter)

3

So now let’s move to the directory by using the CD command. CD being short for change directory. So let’s Type: cd x86_Root (Then Press Enter)

4

So as you can see I have moved to x85_Root and ran a dir to show I am in the folder. You can also know this by seeing H:\x86_Root
Now let’s create a file.

So I like simple using Echo for this. Not sure if you remember Echo from my last post but simply echo just adds what is follow on the screen, such as when I used echo Hello CLI!. Well you can also use this to create a file with the text. By using the > you populate the following file with what is before it. This will be helpful later but for now let’s just echo text into a file. So let’s Type: echo Hello CLI! > Hello.txt  (Then Press Enter) You can use other file types but I like Text or .txt for just playing.

5
Now I have ran dir to show you the file but let’s see the content. So use the type command.
Type: type Hello.txt (Then Press Enter)

6

That is all for today, but as you can see as we move further and further this will get more complex.

My Suggestion: Have a backup before you attempt anything on your PC seriously.

Why CLI or the Command Line Interface is a Techs friend?

Warning! Any computer manipulate in is done at your risk!

So most of us use a GUI (Graphical User Interface) now but a true geek like me loves the CLI or Command Line Interface. Most people will never use it, but if you want to learn computers inside and out you need to know it.  So be it Microsoft, MAC OS, or Linux/Unix the command line is used. So let’s have some fun.

For this example I am using Windows and will be needed in the future as I post little things.

Below is basic steps to get to your CLI in Windows.

Windows NT, 2000, and XP
1.    Click Start.
2.    Click Run.
3.    Type cmd or command and press Enter.

Windows Vista and 7
1.    Click Start.
2.    Type cmd and press Enter.

Windows 8 and Windows 10
1.    Click Start.
2.    Type cmd and press Enter.
So now you have a windows that kind of looks like this.

CLI1

So know what? Well by typing in help and pressing enter (Type: HELP and press enter) you should get a long list of commands you can use.  For playing around I would just use things like DIR or ECHO but trust me we will get into much more complexity such as pipping or adding/editing a file with a command dump.

So after the help list you can Type: CLS and press enter to clear the screen.
So let’s have some fun now so using the ECHO command lets output something to the screen
Type: echo Hello CLI! (Then Press Enter)
You should get the below.

Echo Hello CLI!

Now this is just a beginning step but one that will be used in the future so when I discuss networking basic I my ask you to run IPCONFIG in CLI so you can see things such as IP Address and MAC Address. So as stated above use at your own risk, but have fun and look at the great book in the cloud known as google.com for more info.

My Suggestion: Have a backup before you attempt anything on your PC.

 

-Daryl Jiles