[Explanation] CLI(Command Line Interface) Basics 06-26-2013, 06:44 AM
#1
This is one of MY Tuts I made official on another site.
UNDERSTAND THIS IS FOR REAL BEGINNERS
This is not a pointless thread. This is a real topic I hear people having issues with and I think its a prevalent topic in today's new GUI formatting. Normally people don't know what goes on behind the program and this topic will explain that in a more restricted sense toward the CLI format.
Foreward
Any person in the IT field needs to know basic CLI (Command Line Interface). Now, normally people who see that when they are in the middle of a hack go, "Why do we need to do this old stuff?" or "What is this bullshit, I have Windows 8 not Windows 3.1!" Anybody who is a SUCCESSFUL HACKER has to know these basics and honestly it wouldn't hurt to know things about this area. Deciphering CLI
So, how does it work? Its just as if your having a IM(Instant Message) session with your computer. The Computer starts off the conversation with a specific set of characters called a Prompt.
Code:
Computer: Would you like to play a game?
Human: _
You proceed to type a command..
Code:
Human: What kind of game?
Computer: _
The PC then executes the command and most likely displays information about the command you specified.
Code:
Computer: A very fun game.
Human: _
Once you get your new Prompt it means your able to put in your next instruction.
![Smile Smile](https://sinister.ly/images/smilies/set/smile.png)
In today's new GUI's (Graphic User Interface) you can just give command by clicking your mouse. CLI is just like using the Search Bar in Google. You type in your Keyword and your press Enter. However, programs are restricted to the certain keywords that are embedded into that program.
Example of CLI: Let's say you want to open up and view the contents of a specific folder. From the command line, you would type a command(in this case "dir", we will discuss that too), and the computer would respond with a screen like this one.
Spoiler:
In GUI, you would navigate to your C Drive(like a normal person) look for Users and then your name. Then it will display the same folders, just with more pizazz and pretty colors.
Spoiler:
The point is that whichever interface you might use, the output is essentially the same.
Accessing the Command Line
There are several ways to get the Command Line using the Run Dialog Box
Windows XP: Click Start -> Select Run -> Type "cmd" or "command" (without the quotes) -> Press Enter (on your keyboard)
Windows Vista or 7: Locate the search bar in Start -> type "cmd" or "command" (without the quotes) and press Enter (on your keyboard)
Windows 8: On the keyboard hold down the windows key (4 tiles button) and press "R" -> type in "cmd" or "command" -> press Enter (on your keyboard)
Alternatively in the start menu under programs, there's an accessories link and you should click on the Command Prompt application.
If you take time to notice in this picture:
Spoiler:
The default location the CLI refers to is the C:/Users/UserName.
At any point in the CLI you can type in the command "exit" and press Enter and the Window will close.
Command Prompt
Command Prompt is always focusd on a specific directory or folder (as most will call it). Any commands you give will be focused only on the objects found at where the command prompt is focusing. If you see a prompt look like this:
Code:
C:/>
You should know that it is focused in the C Drive.
If the prompt looks like this:
Code:
C:/Users/303315
It will be focused on the 303315 location.
File Names and File Formats
Windows recognizes each program and data as an individual file. Each file has a name, which is stored with the file on the drive.
Fun Fact: In true Windows DOS file types, none can be longer than 8 characters long. The file extensions can only be 3 characters long. Most computer programmers still honor those limits in reference to the basic Lets look at the unacceptable characters that cannot be included in the file name. Examples: ( / \ [ ] | + = ; , * ? ). The Period or dot is ALWAYS going to separate the file name and the file extension. This format or system was known as the "8.3 Naming System". (The name being 8 character and 3 character to represent the actual format)
All file types that are accepted throughout the system are based on Microsoft DOS. If we look at those file types by referencing the above information:
Code:
john.exe
system.ini
test2.doc
driver.sys
logo [no extension just makes it a file]
teln.h
Other File Types like:
Quote:4charext.execThese are not acceptable True file types. (inside the file names i showed the reason they were not true. char is short for character)
waytoolong.fil
bad?char.bat
.no
The extension is the MOST important part of the file type. The reason why is because the extension tells Windows what program the file should open with.
Program files use ".exe" (for executable) or ".com" (for command)
Anything that is not a program is some form of data to help support that program. Different programs use different types of files. For instance, Microsoft Word uses ".docx" (or .doc for versions prior to 2007), while WordPerfect uses ".wpd" and Powerpoint uses ".pptx" (or .ppt for older versions before 2007)
Changing the Extension of a file does NOT change its contents. All it does is confuse Windows into not knowing what program to open it with.
All files are stored on the hard drive in binary(Click here for info: http://bit.ly/11rIRMw) format. But every program has its own way of reading and writing this binary data. Every unique method of binary organization is called a file format. In order for programs to understand each others format, there had to be a common database of binary. This is now called "Ascii" or "American Standard Code for Information Interchange. Ascii defines 256 eight-bit characters. Alphabet letters, numbers, symbols.
Ascii was great for a base of communication. Soon after, people around the world were being involved with computers and they needed their own version that incorporates their language. Eventually, the Unicode is invented and now it incorporates every character in most languages. the first 256 will always be the same as a tribute to Ascii.
Drives and Folders
When working with a CLI environment, you need to be able to focus the prompt at a specific drive and then the specific folder thast contains the programs and files you need to access. This can be a bit more complicated than it sounds like.
When Windows is booted, drives get assigned a letter(or name) to each hard drive partition(click here for info http://bit.ly/141ssE2) and to each disc or floppy drive. This is the order they are booted
Code:
A:/ <- Floppy
B:\ <- Floppy (if installed)
C:\ <-Hard drive
all the way to
Z:\ <- Hard drive (if have more than one installed)
Optical Drives (or Disc Drives) are labelled a letter right after the last hard drive is installed
Whatever the Drive may be called, Windows uses a Hierarchical directory to organize the contents of those drives. All files are pulled into a group called a Folder. You'll hear techies say "Directory" instead. That's a term used in the DOS days. A folder can be inside another folder (called subfolders). However, 2 files cannot be named the same thing. Any folder that starts as the first folder of many more is called the "root".
When you describe a drive, you use its letter and a colon.
Quote:Code:
The C drive
C:
To describe as a root you add a backslash
C:\
The exact location of a file is called its Path.
Code:
Possible paths
C:\Program Files
C:\WINNT\System32
B:\Reports
D:\
This was created by me(303315) on another forum. I allow people to use this for EDU purposes only. Copying and pasting is fine as long as you refer to me please.
![[Image: twyq7AI.gif]](http://i.imgur.com/twyq7AI.gif)