15
How To CS234 Socratis Tornaritis 1 Unix

How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

How To

CS234Socratis Tornaritis

1

Unix

Page 2: How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

• WindowsUse putty to remotely login to a Unix server

• MacFire up Terminal (to quit: type exit, then press ⌘-Q)

2

Enter command

Page 3: How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

• To get help on any command, use the manual ~$ man ls

3

Unix 911

Page 4: How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

• Clear the screen~$ clear

• Recall a command Use up / down arrow keys

• Edit commandRecall command, use left / right arrow keys, make changes, press <return>

4

Command essentials

Page 5: How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

• List contents of directory~$ ls (normal listing)~$ ls -l (long listing)

5

Directory listing

Page 6: How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

• ~$ ls -a (all)shows . (current), .. (parent) directories and . files

6

. entries

Page 7: How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

* match any character(s)

? match a single character

[] match any of the indicated characters

{,} match any of the indicated patterns

7

Wildcards

Page 8: How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

8

Wildcards

Page 9: How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

9

-rw-r--r-- 1 stornarSIUE staff 0 Aug 16 13:23 test

drwxr-xr-x 5 stornarSIUE staff 170 Jul 26 2013 uploads/

File type: [-]: file, [d]: directory

Privileges: [r]: read, [w]: write, [x]: execute groups: [u]: user, [g]: group, [o]: other

links: 1

file owner: stornarSIUE user's group: staff

size: 170 date: Jul 26 2013 name: uploads/

Directory contents

Page 10: How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

• ~$ cat filenameList file contents to the screen all at once

• ~$ less filenameList file contents to the screen, one screenful at a time. Press the <spacebar> for the next screenful. Press <q> to quit.

10

File Contents

Page 11: How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

• cd: change directory

• mkdir: make directory

• rmdir: remove directory

• cp: copy file

• mv: move file

• rm: remove file

11

File management

Page 12: How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

12

cd

Page 13: How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

13

mkdir, rmdir

Page 14: How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

14

cp, mv, rm

Page 15: How To Unixstornar/courses/notes/cs234/howTo-unix.pdf•Windows Use putty to remotely login to a Unix server • Mac Fire up Terminal (to quit: type exit, then press ⌘-Q) 2 Enter

15

File permissions