1 of 15

Meet a Framework

The Command Line Interface (CLI)

DB

STDIO Ghana

2 of 15

GUI vs CLI

GUI - Graphical User Interface

CLI - Command Line Interface

API - Application Programming Interface

DB

STDIO Ghana

3 of 15

Why use the CLI?

1.Great for administration

- Much greater power and control

2. Great for repetitive/recurring tasks

3. Operating systems already implement many useful programs

-Take advantage!

DB

STDIO Ghana

4 of 15

Windows CMD Basics

Directory Structure

Drive root is C:\

-Absolute Path/Relative Path

-File Permissions/Access

DB

STDIO Ghana

5 of 15

Windows CMD Basics

Basic Commands

dir - List files in your directory

cd - Print your current path

cd path - Change context to a different directory

copy path1 path2- Copy a file

move path path - Move or rename a file

del path - Unallocate space used by a file

rmdir path - Delete an empty directory

mkdir path - Create a new directory

type path - Display the contents of a text file

findstr - Search for a string within the file system

DB

STDIO Ghana

6 of 15

Windows CMD Basics

Batch Scripting (Hello World)

  • Combine multiple commands to perform a userful task

DB

STDIO Ghana

7 of 15

Windows CMD Intermediate

Programming commands

ss64.com

Redirection/Piping/Logical Branching

Challenge Script

DB

STDIO Ghana

8 of 15

Windows CMD Advanced

Environment Variables

DB

STDIO Ghana

9 of 15

Linux Bash Basics

Directory Structure

System root is /

-Absolute Path/Relative Path

-File Permissions/Access

DB

STDIO Ghana

10 of 15

Linux Bash Basics

Basic Commands

ls - List files in your directory

pwd - Print your current path

cd path - Change context to a different directory

cp path1 path2 - Copy a file

mv path path - Move or rename a file

rm path - Unallocate space used by a file

rmdir path - Delete an empty directory

mkdir path - Create a new directory

cat path - Display the contents of a text file

grep - Search for a string within the file system

DB

STDIO Ghana

11 of 15

Linux Bash Basics

Bash Scripting (Hello World)

DB

STDIO Ghana

12 of 15

Linux Bash Intermediate

Programming commands

man / info

more, less, head, tail

grep exercises with c (count), v (inverse), various flags

uniq, sort, cut (awk / sed)

ps, top, pkill

hexdump

mount,df, du

diff, md5sum

DB

STDIO Ghana

13 of 15

Linux Bash Intermediate

Redirection/Piping/Logical Branching

Challenge Script

DB

STDIO Ghana

14 of 15

Linux Bash Advanced

Environment variables

Configuration files

- /etc

- hidden home files

DB

STDIO Ghana

15 of 15

Alternate/Embedded CLIs

Many times, programs will present their own CLI to the user (independent of OS)

  • ftp
  • mysql
  • sqlite
  • netsh
  • irc

DB

STDIO Ghana