Top Banner
EMT 2390L Lecture 2 Dr. Reyes
21

EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Dec 26, 2015

Download

Documents

Samantha Scott
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

EMT 2390LLecture 2

Dr. Reyes

Page 2: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Outline• What is the Shell• Basic commands• Linux Filesystem• System commands

Page 3: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

What is the Shell?• Shell - a program that takes keyboard commands

and passes them to the operating system to carry out

• Types of Shells:o C-Shell: csh, tcsho Bourne Shell: sh o Bourne Again Shell: bash

• When using a GUI, a terminal emulator is used to interact with the shello KDE uses konsoleo GNOME uses gnome-terminal

Page 4: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Shell Prompt

Page 5: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Session Privileges• Prompt ending with:

o $ - regular user, privileges varieso # - superuser

Page 6: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Command History• Press up-arrow key for previous command• Press down-arrow key for next command• Press left-arrow key to move back in the same

line• Press right-arrow key to move back in the same

line• Limited support for mouse interaction• Some keyboard shortcuts might not work, as they

belong to Windows:o Ctrl-Co Ctrl-V

Page 7: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Commands• Try the following commands:

o date – displays the dateo cal – displays the calendar o df – disk availableo free – memory availableo exit – to exit the system

Page 8: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Filesystem Tree• Linux uses hierarchical

directory structureo Tree-like structureo Root – First directoryo Drives are not separate trees, instead

they are mountedo You can see the files and the parent of

the current directoryo Each user account is given it’s own

home directory

Page 9: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Commands for Directories• pwd - lists the current working directory• ls – lists the files and sub-directories in the

current working directory• cd – change to the specified directory

o cd /usr/bin – changes to dir /usr/bino cd / - changes to root dir

• Special parameterso . (dot) – current directoryo .. (double dot) – parent directoryo - (dash) – changes to the previous working directoryo ~ (tilde) – changes to your home directoryo ~username – changed to home directory of username

Page 10: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Linux Filenames Facts• Filenames that begin with a period character are

hidden. To display them use ls –a• Filenames are case sensitive• In Linux there are no file extensions such as .doc

or .exe• Avoid using spaces and special characters even if

is supported.

Page 11: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Other uses of ls• Try the following options with ls

o ls /usro ls ~ /usro ls – l

• Most commands have options and argumento command –options argumentso options might be a dash and a single character or two dashes followed

by a word

Page 12: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

ls Options

Page 13: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

ls –l What all that means?

Page 14: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Commands for files• To get the file

typeo file filename

• To read a fileo less filenameo less is better than

more

Page 15: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Some Linux Directories

Page 16: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Some Linux Directories

Page 17: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Some Linux Directories

Page 18: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Some Linux Directories

Page 19: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Some Linux Directories

Page 20: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

Some Linux Directories

Page 21: EMT 2390L Lecture 2 Dr. Reyes. Outline What is the Shell Basic commands Linux Filesystem System commands.

©1992-2012 by Pearson Education, Inc. All Rights Reserved.

Assignments• Check the class OpenLab site for new Labs

o Lab 0 is mandatory.

• Check Blackboard for new Quizzeso Quiz 0 is mandatory.