some basic unix commands

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: flint

Post on 09-Feb-2016

76 views

Category:

Documents


0 download

DESCRIPTION

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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Some basic Unix commands

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: Some basic Unix commands

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: Some basic Unix commands

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: Some basic Unix commands

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 editorother editors are available on the system as applications

Page 5: Some basic Unix commands

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: Some basic Unix commands

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: Some basic Unix commands

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: Some basic Unix commands

8

Some Basic Commands

who: Who are using the system.

terra$ whokatchab ttyp0 Aug 11 08:47scott tty02 Aug 10 11:01jenny tty03 Aug 10 07:21

terra$ who am ikatchab ttyp0 Aug 11 08:47

who am i: Who am I.

Page 9: Some basic Unix commands

9

Some Basic Commands

ls: List the files under current directory

terra$ lsreadme cs211.2.ppt cs211.ppt.gz notes.zip cs211.1.ppt cs211.3.ppt make/ shell/

terra$ cat readmeUnix is easy!terra$

cat: Display the content of a file

Page 10: Some basic Unix commands

10

Some Basic Commands

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

terra$ cat^cterra$

lynx: surf the net.

terra$ netscape

netscape: surf the net. ONLY WHEN X is running

terra$ lynx www.yahoo.com

Page 11: Some basic Unix commands

11

Some Basic Commands man: See the manual page of a command.terra$ man catReformatting page. Wait... DoneUser Commands cat(1)NAME cat - concatenate and display filesSYNOPSIS 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: Some basic Unix commands

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: Some basic Unix commands

13

Communication Utilities in UNIX

Page 14: Some basic Unix commands

14

The talk Command

Page 15: Some basic Unix commands

15

A Complete talk Session

Page 16: Some basic Unix commands

16

A Complete talk Session

Page 17: Some basic Unix commands

17

A Complete talk Session

Page 18: Some basic Unix commands

18

The write Command

Page 19: Some basic Unix commands

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: Some basic Unix commands

20

Email Address

Page 21: Some basic Unix commands

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: Some basic Unix commands

22

Local login

Page 23: Some basic Unix commands

23

Remote Login