1 some basic unix commands u understand the concept of loggin into and out of a unix shell u...

23
1 Some basic Unix commands Understand the concept of loggin into and out of a Unix shell Interact with the system in a basic way through keyboard and terminal window Create, copy and delete files, edit files Understand and use commands like: ls cd mv cp rm cat date mkdir rmdir Be able to navigate up and down in the file system

Upload: shawn-jordan

Post on 23-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

1

Some basic Unix commands

Understand the concept of loggin into and out of a Unix shell

Interact with the system in a basic way through keyboard and terminal window

Create, copy and delete files, edit files Understand and use commands like: ls cd mv cp rm cat

date mkdir rmdir Be able to navigate up and down in the file system

Page 2: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

2

Logging in and out

As a Unix user you can log in and out When loggin in, the system checks your user name and

password – if correct, the system starts a shell for you and places you in the starting directory

The shell runs as your process until you log out The shell gives you a prompt and interprets what you

type

Page 3: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

3

Interacting with the system

Default input from the keyboard Default output to the terminal window When hitting return the shell interprets what you have

typed The shell finds a command with that name and starts a

process to execute the command During this time the shell process sleeps and wakes up

when the command process is done

Page 4: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

4

Working with files

Creating files– Can use vi or any editor– Can use cat with input and output redirection

Copying files– cp makes a copy of an existing file– cat can do it also, we practice this to understand I/O redirection

Deleting files: rm Editing files

we will learn about vi, the most available Unix editor

other editors are available on the system as applications

Page 5: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

5

More important commands

ls lists the files in the current directory by name cd changes your position in the directory tree mv moves a file from one directory to another rm deletes a file date prints the current date and time mkdir creates a directory rmdir deletes a directory (must be empty) All Unix commands have options

Page 6: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

6

Navigating in the directory tree

The cd command changes your position in the directory tree, destination is parameter, it must be the name of a directory visible in the current directory– cd without parameter

– Relative movement (relative pathname)

– Absolute movement (absolute pathname)

–cd .. and cd .

Page 7: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

7

To Make a Good Password

A good password– Easily remembered by YOU– Difficult to be guessed by others

Tricks to make a good password– Pick letters from a sentence

I love Unix Ioenx– Pick letters, numbers, and symbols that

sound, look like, or replace a phrase I hate carrots! ih8^s!

A bad password not only harms you– Attacks are much easier with a compromised account on a

computer

Page 8: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

8

Some Basic Commands

who: Who are using the system.

terra$ who

katchab ttyp0 Aug 11 08:47

scott tty02 Aug 10 11:01

jenny tty03 Aug 10 07:21

terra$ who am i

katchab ttyp0 Aug 11 08:47

who am i: Who am I.

Page 9: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

9

Some Basic Commands

ls: List the files under current directory

terra$ ls

readme cs211.2.ppt cs211.ppt.gz notes.zip

cs211.1.ppt cs211.3.ppt make/ shell/

terra$ cat readme

Unix is easy!

terra$

cat: Display the content of a file

Page 10: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

10

Some Basic Commands

Ctrl-c: (press <Control> and c at the same time) Interrupt the current task.

terra$ cat

^c

terra$

lynx: surf the net.

terra$ netscape

netscape: surf the net. ONLY WHEN X is running

terra$ lynx www.yahoo.com

Page 11: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

11

Some Basic Commands man: See the manual page of a command.terra$ man cat

Reformatting page. Wait... Done

User Commands cat(1)

NAME cat - concatenate and display files

SYNOPSIS cat [ -nbsuvet ] [ file ... ]

DESCRIPTION

cat reads each file in sequence and writes it on the stan-

dard output. Thus:

example% cat file

prints file on your terminal, and:

example% cat file1 file2 >file3

concatenates file1 and file2, and writes the results in

file3. If no input file is given, cat reads from the stan-

dard input file.

OPTIONS--More--(11%)

Page 12: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

12

Commands covered today

File Manipulation Commands:– copy (cp), rename (mv), print (lpr), examine a file (head,

more, cat), search a file (grep), delete (rm) Miscellaneous commands

– echo, date, cat Basic File Compression – gzip, gunzip Finding Utilities and help

– which, whereis, apropos, man, info Communicating online

– Chat (write/talk) and email (pine)

Page 13: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

13

Communication Utilities in UNIX

Page 14: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

14

The talk Command

Page 15: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

15

A Complete talk Session

Page 16: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

16

A Complete talk Session

Page 17: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

17

A Complete talk Session

Page 18: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

18

The write Command

Page 19: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

19

E-Mail Programs

Some Programs available in Unix/Linux– Mail – most basic, low level mail command– ELM– PINE (PINE Is Not Elm), more user friendly text mail– Outlook, GUI driven– Eudora– Netscape Mailer

Page 20: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

20

Email Address

Page 21: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

21

PINE

A menu-driven client Uses pico as an editor Allows MIME attachments Main Menu

– C - Compose to write a message

– I or L - View messages

– Q - Quit

Page 22: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

22

Local login

Page 23: 1 Some basic Unix commands u Understand the concept of loggin into and out of a Unix shell u Interact with the system in a basic way through keyboard and

23

Remote Login