You are on page 1of 3

I.

INTRODUCTION

COMMAND LINE SYNTAX refers to the rules and conventions that dictate how
commands should be written and executed in a command-line interface (CLI). The CLI is
a text-based way to interact with a computer's operating system or software by typing
commands into a terminal or command prompt. Here are some key elements of
command-line syntax

II. Learning Objectives:

At the end of the lesson, students should be able to:

1.Understand the basics of command line syntax


2.Learn common commands line syntax, including commands, options, and arguments
3.Perform basic command in the command line interface

CONTENT

III.

Command line syntax is the the set of rules that dictate how commands written or to be
structured and entered in a command-line interface (CLI).

This is important because when you know how to write a command you can use
efficiently the CMD (Command prompt) by that you can configure, navigate file system
and even find an malware on your device

Command - A specific action assigned to a program to perform a specific task. It


commonly refers to a specific word or phrase that tells the computer what to do through a
command line interface or shell, depending on what kind of system is being used.

Example: ls -l Listing Files with Details,

cp - Copying Files,

mv old_name new_name -

Moving/Renaming Files

rm - Removing Files

Options and Arguments: while arguments give the command specific information or
targets, options modify the behavior of the command.

Argument: The directory you want to list (similar to a noun).

Option: The option that specifies additional details, like file sizes (similar to an
adjective).

Example: ping -n 5 www.example.com

www.google.com is the argument, representing the website you want to ping.

-n 5 is the option, specifying that you want to ping the website 5 times.

Syntax: This is the rule book or recipe for how to put your command together. If you
follow the rules, the computer understands you.

Key word: it’s like protocol/law in writing a command so the computer understand
you
Wildcards: A wildcard is a symbol that takes the place of an unknown character or set of
characters. Commonly used wildcards are the asterisk ( * ) and the question mark ( ? ).
Depending on the software or the search engine you are using, other wildcard characters
may be defined.

Example:: Asterisk (*) - Matches any sequence of characters

Question Question Mark (?) - Matches any single character

Square Brackets ([]) - Matches any single character within the specified range

Brace Expansion ({}) - Generates multiple strings:

Double Asterisk () - Matches directories and sub directories recursively

Redirection: The process of using the input/output of a file or command to use it as an


input for another file. It is similar but different from pipes, as it allows reading/writing from
files instead of only commands.

it is useful for manipulating and managing data flow in various operations. Unlike
pipes, which primarily deal with the output of commands, redirection involves
working with files, enabling data transfer between files and commands

Quotes: Sometimes, your instructions have spaces or special characters. Quotes help
the computer understand that everything between them is one thing. For example, if you
say "copy 'my document.txt' new_folder," the computer knows that the whole name is "my
document.txt."

Example: lets create a file with spaces in the name


Open Notepad, type something, and save the file as "loyal

summer.txt" on your desktop.

open command prompt

let's navigate to desktop using the this command: "cd desktop"

Now, let's use the copy command. Without quotes,

copy loyal summer.txt new_folder

it may not work because the computer may think you're trying to copy three
separate things: "loyal," "summer.txt," and "new_folder.

in order for our command to work and understand by the computer, let's use
quotes to understand that loyal summer.txt is one thing ("loyal summer.txt”)

Escape Characters: These are like secret codes that help the computer understand
special characters. If you have a space in a name and want the computer to recognize it,
you might use a backslash () before the space. So, "file\ with\ space.txt" tells the
computer it's one file with paces.

Create a Folder with Spaces:

Create a folder on your desktop named "Loyal summer"

Open command prompt

Navigate to Desktop(cd desktop)

Navigate to the Folder with Spaces (Without Escape) “(cd Loyal summer)”
This could be confusing for the computer because it might interpret "Loyal" and
"summer" as separate things.

Navigate to the Folder with Spaces (With Escape)

Let's use escape characters to tell the computer that the space is part of the folder
name

place the back slash before the space “(cd Loyal\ summer)”

IV. In conclusion understanding the command line syntax is important. Learning objective
focus on understanding commands, options, and arguments, syntax, wildcards,
redirection, quotes and escape characters.

Command line syntax serves as a rule book or providing the structure and guidelines for
writing commands, because of this I as a user allow to configure settings, navigate the
file system and execute various tasks including identifying and addressing potential
security threats such as malware

In essence knowing the capability of command prompt and understanding the syntax in
writing a command is useful because I maximized the capability of the feature that I can
use in my day to day task

V. REFERENCES: https://youtu.be/XN-s9WE6AV4?si=3xtN_JOLvsUtnRAJ
https://youtu.be/ix6q3hjqrsM?si=ELR6MKrz5SDil6GS https://youtu.be/qJ4Y2EtH59c?
si=E1ZT1nfNEnq_6v4k https://youtu.be/S2cpswEQhEc?si=4W9WRtBIjA0h7hhS

https://www.lifewire.com/redirection-operator-2625979

https://kb.iu.edu/d/ahsf

Appendices:

You might also like