Title: ????? ?? t2
1?????? 1
- ????????????
- ????? ?? t2
- ????? ?????? ?-
- Unix
- ????? ?????? ?-Unix, gcc
2?????? ????? ???"? !
3???? ?????
- ????? ????? ????? ??????? ?????? ?????
- ???? ?? ???? ????? ?????, ?? ?????? ????? ???????
????? - ???''? ????? ?????? ?? ????? ?????
- ????? ????? ??????? ?????? ?????
4????????????
- ??? ???? http//webcourse.cs.technion.ac.il/23412
2 ???? ???? ???? ?? ????? ??????? ????? ??????. - ???? e-mail ?????? ???? ?????? ?????? ? e-mail
?? ?????, ?? ?????? ???? http//grades.cs.technion
.ac.il, ?????? ??????? Settings/AutoUpdate ??????
?? ??? "Announcements Update" ????? e-mail.
5???? e-mail ?? ?????
6?????? ???
- ????? ?????? ?????? ????? ?????? ??? ???????
????? - C 5
- ADT 10
- C-Shell 5
- C -10
- ????? ?????? ??? ?????
- ??? ????? ???? ????? ?????? ?? ??????. ?????
??????? ?????? ?????, ?? ?????? ?????? ?????? ??
??????. - ???? ?????? ????? ????? ?? 5 ?????? ???? ?? ???
?????.
7?????? ???
- ?????? ???? ?????? ???????? ?????? ???? ?????,
????? ?????? ??????. - ????? ????? ???? ?????? ???? ?????
- ?? ????? ???? ????? ?????? ?? ??? ??????? ????
????? ????????. ????? ?? ??? ??? ?? ????? ????
?? ??? ?????? ????? ?????? - ??? ????? ?? ???? ?????? ??? ?????? ??? ???? ???
????? ??????? ??????
8????? ????
9?????? ???
- ???? ?????? ??? ?? ????? ???? ????? ?? ?????
???? ??? ?? ?????, ??? ???? ???? ????????? ???
??? ?????. - ????? ?????? ?? ?????? ???? ????? ????? ?? ??????
????? ???? ?? ??? ?????? ?? ??? ??????? ?????.
?? ?????? ??? ????? ????????? ??????? ????
?????/????? ????? ?????.
10?????? ???
- ?? ????? ???? ?????? ?? ????? ?????????. ????? ??
?? ????? ?? ??????? ?-t2 ?????? ?? ?????? ??????
?? ????? ????? ???? ?????? ??? ???? ??????
??????. ?? ?? ???? ????? ????? ?? ????? ?? ?????
??????????.
11???? ?????????
12????? ?? t2
- ?????? ????????? ?? ???????? ????? ?-t2
- ??? ????????? ?? t2 ??? stud.technion.ac.il
- ?????? ??? ???????? ?????
- ???? ?-t2
- ???? ??? ???? ????? ??? ??? ?? ???? ????? ??
?????? ?debugging (????? ???? ???? ???? ???)
????? ?t2-. ????? ?? ?? ?????? ????? ?????? ????
?-t2.????? ???? ?????? ???? ????? ???? ?????
???? ?? ?????. ???? ???? ???? ??????? - Windows
- Cygwin (on Windows)
- Linux
13????? ?????
- Linux ?-Windows ?? ?????? ????? (Operating
systems) - ?????? ????? ?? ??? ??????? ????? ?? ????? ?????
- ?????? ??? ?????? ?????? ?????? ?????? ?????
?????? ???? ????? - ????? ??????, ????? ???'. - ????? ???? "??? ????" ????? ??????
14????? ?? t2
SSH Secure Shell Client??????? ?-t2
SSH Secure File Transfer Client ????? ?????
???? ??????
Windows / Linux
Windows / Linux / Cygwin
Linux
15t2 - Linux
- Linux??? ????? ?????? ?????? Unix??????? ?- t2.
- ?????? ?-Unix ?????? ????? ????????? ??? ?????
(?? ??????? ??? ?-Windows) - ????? ?? Unix ???? ????? ?????? ????? ????? ???
?? ??????? ????? ????? - ?????? ?????? ????? ?????? (command line)
- ??????? ???? ???? ????? ??????, ???? ?????? ?????
prompt - ???-prompt ???? ???? ??? ????? ?? ????? ????
???"? ????? Enter. ????? ???? ?? ?????? , ?????
?????? ???? ??? ?? ? prompt ???? ????? ??? ?? ??
?????? ????.
16????? ?? Unix (?-t2 ??? (SSH
- ????? ??????? - ????? ?? ???????
- Computing Services -gt Services -gt software
support -gt SSH - (??? ????? ?????? ?????)
the network name of t2
computers output
users commands
command line
prompt
http//system.cs.technion.ac.il/Software/software_
support.htm
17????? ????? ??? ??????
???? My Computer
???? SSH
???? ????? ?''? ????? ????? ??? ?????
?????? ????? ?????? (t2)
???? SSH FTP
18????? ?? (Go-Global) t2
- ?????? ?- SSH clients ?? ???? ?????, ?????? ???
??? ???????. - ????? ????? ?? ??????? ?????? ????? ???????
????? ??? debugger ddd -
http//www.technion.ac.il/GG/IPviewer.html
19????? ?????? UNIX
- Cygwin ????? ?????? UNIX ???? ?? windows
- ??????? ??? ??????, ?????? ?? ?-PC ???? ????
????? ?? ???? ??? ?? ?-t2 - ??????? ???? ??' ?????? ?????? ?? UNIX ????
?????? ?????, ?? ???? ???? ???? ???'. - www.cygwin.com
20???? ????
- ???? ???? ???? ???? ?????? ????? ????? ???? ??
?????, ??? Course Material -gt Helpers
21 UNIX?????
22????? ?????? ?-Unix
- ?????? ??????? ???? (file)
- ???? ???? ?? ?????
- ??? ????? ?? ?? ???? ????????? ????? ???? ????
?"? ??? ASCII ?? ????? ???? ????. - ??? ???? ?? ??
- ??? ?????? ?? ???? ???
- ???? ????? ?? ???? ?? ?????
- ????? ??? ???? ??? ?????? ltnamegt.ltextensiongt
- ???? test.c - ???? ???? ???? C
- hello.o - ???? object
- ????? ?? ????
- ??? ????? ?? ?????
- ????? ???? ????? ????? ?? ????? ????. (??? ????
????? ????? .exe)
23????? ?????? ?- Unix
- Unix ??? ????? ????? ???????. ??? ????? ?? ?????
???? ?????. ????? ?? ???? ???? ?? ????? ??? ??
??? ???? ??????. - ?- Unix, ??? ? MS-DOS ??-Windows, ?? ??????
(Directories) ???? ???? ????? ????? ?????? ?????
????. - ??????? ? - Unix ??????? ??? ????? ????? ?????
????? ??????? ????? ?? ??. ???? ??? ???? ??????
???? ?? ?? ?????. ?????? ???? ??????? ?????? ????
?????? ????. - ? - Unix ???? ????? ?? ?????? ??????? ??????? ??
?????? ???????.
24????? ?????? ?- Unix?????
- ?????? ???? ???? ??? ???????, ari ?- uri. ??
?????? ????? ?????? ?? ???? ???? - ???? ?????? ??????? ??????
- ?????
- ??????
25????? ?????? ?- Unix
- ?-Unix ??? ??? ?????? ?????? "????" ??????? ?????
"??????? ???????". - ??????? ??????? ?? ?? ????? ????? ?????? ???? ???
(home directory). ???? ?????? ???? ?????? ???,
??? ???? ??????? ???? ???. ???? ????? ??? ??????
?''? ????? cd. - ???? ????? ????? (?? ??????) ??? pathnames full
?? relative pathnames (????? ??????? ???????)
26??????? ??????? ?????? ?-Unix
- / ?????? ????? (root) ?? ???? ????? ?-pathname
- . ??????? ???????
- .. ??????? ?????? ?? ??????? ??????? "??????
???" - ?????? ???? ?? ?????? ??????
- uri ?????? ???? ?? ????? uri
- ?? ?????? ???????? ??????? ??????
27????? ?????? ?- Unix
- ?? ??????? ????? ??????
- /usr/uri/progs/Hello.c
- /usr/uri/progs/Matam
- progs
- /progs
- ./hw1
- ../hw2
- ari/progs
- mtm/public/0809a/ex1
- /progs/
28?????? ?????? ?? ??????
- ???? ???? ?? ??????? ????? ????? ?????? ??
??????? - ????? ??? ??????? ???????
- ????? ??????? ????? (????? ?? ??????? ???????)
- ????? ???? ?????? ?????
- ????? ?????? ????
- ????? ??????
29?????? ?????? ?? ??????
- pwd
- ????? ??? ??????? ???????
- cd ltdirectory namegt
- ????? ??????? ????
gtpwd /usr/ari
gtcd progs gtpwd /usr/ari/progs
gt cd .. gtpwd /usr/ari
30?????? ?????? ?? ??????
- ls ltdirectory namegt
- ????? ?? ???? ???????. ??????, ????? ?? ????
??????? ??????? - gtls
- progs
- ????? ?? ???? ??-?????? progs
- gt ls progs
- hello
- hello.c
31?????? ?????? ?? ??????
- ???? ????? ?? ????? ?????? ????? ????? ????
??' ??????
?? ?????
??' ????
gt ls -al drwxr-x--- 14 ari 1536 Aug 5
1404 . drwxr-xr-x 48 root 1024 Aug 1 0430
.. -rw------- 1 ari 2425 Mar 12 1159
.login -rw-r--r-- 1 ari 2425 Mar 12
1159 moshe drwx------ 2 ari 512 May
13 0330 progs
??????
?????? ?????? ?????? ????
??? ?????
??????? ???? ??-??????, ???? . ???..
32?????? ?????? ?? ??????
- mkdir ltdirectory namegt
- ????? ?????? ????. ??????, ????? ?????? ??? docs
- rmdir ltdirectory namegt
- ????? ??????. ??????, ????? ?? ??????? docs
- ???? ????? ?????? ?? ?? ??? ????.
gt mkdir docs gt ls docs progs gt ls docs gt
gt rmdir docs gt ls progs
33?????? ?????? ?? ????? ???????
- ???? ???? ?? ??????? ????? ????? ?????? ?? ?????
??????? - ?????? ????? ?? ??????
- ?????? ????? ?? ?????? ??????? ?????
- ????? ?? ?? ??????/????
- ????? ????/??????
34?????? ?????? ?? ????? ???????
cp options file1 file2 cp options file1
file2 directory ????? file1 ?-file2 ?? ????? ???
?? ???? ????? ?-directory. ?? ???? ???? ????,
???? ????? ???? ????. ?? directory ?????, ?????
???? ???? ???????. ??????? -i ??? ????? ????
????? ???? ????. -r ???? ????????? ?????? ?? ??
????? ???-??????? ???.
????? ???? ???? ?? hello.c ??? prog1.c
????? hello.c ? prog1.c ??????? progs
????? ???? ???? ?? ??????? my-dir ??? new-dir
gt cp hello.c prog1.c gt ls hello.c prog1.c
gt cp hello.c prog1.c progs gt ls progs hello.c
prog1.c
gt cp -r my-dir new-dir
35?????? ?????? ?? ????? ???????
- rm options files
- ????? file ??? ?? ????. ??? ????? ???? ?????
????? ????? ????? ??????? ?? ???? ?????. ?? ???
????? ????? ????? ????? ????? ??????. - ???????
- -f ??? ????? ??? ????? ????? ??? ?????.
- -i ??? ????? ???? ????? ?? ????.
- -r ?? file ??? ?????? ??? ???? ??? ?? ??????
???? ??-??????. - ????? ????? ?? ????? ????? ??????
- ????
- ? - Unix ??? ??????? ?????? ????? ????? ??????.
36?????? ?????? ?? ????? ???????
- mv options sources target
- ????? ?????? ?? ????? ??????? ?? ????? ???? ????.
????????? ?? - gt mv old_file_name new_file_name
- ?? ????? old_file_name ????? ?- new_file_name
????? ????? ??? new_file_name ???? ???????
???????, ????? ????? ???? (overwritten). - gt mv old_dir_name new_dir_name
- ?? ??????? old_dir_name ????? ? -new_dir_name
????? ??????? ??? new_dir_name ?? ????? - ????? ??????? ??? new_dir_name ?????,
old_dir_name ???? ?? ?????? ?? new_dir_name ! - gt mv file1 file2 dir_name
- ?????? file1, file2 ??????? ??????? dir_name.
- ???????
- -i ??? ????? ???? ????? ???? ????.
37?????? ?????? ?? ????? ???????
- mv options sources target
- ???????
?????? ?? ????? prog2.c ??????? progs
????? ?? ??? ?? ????? hello.c ?- prog2.c
gt mv hello.c prog2.c gt ls prog2.c
gt mv prog2.c progs gt ls progs hello.c prog1.c
prog2.c
38?????? ?????
- ??? ???? ?? ?????? ??????? ??? ????? ????? ?????
?????? ???? ??????. ???? ???? ??? ???? ????
?????? ?????? ?? ??? ???? ???? ???? ??? ?????. - ???? 3 ????? ?? ??????? ??????? ???? ?????
- 1. User - ??? ?????.
- 2. Group - ????? ????? ?????? ?? ??? ?????.
- 3. Other - ?? ??? ???????? ?????? ????? ??"?.
- ??? ??? ????? ?? 3 ?????? ?????
- 1. Read - ??? ???? ?? ????? (??????) ?? ?????.
- 2. Write - ??? ???? ?? ????? ?? (?????) ??
?????. - 3. Execute - ??? ???? ?? ????? ?? ?????.
????? ?????? ??????? ???? ????? ?? ?????
39?????? ?????
gt ls -al drwxr-x--- 14 ari 1536 Aug 5
1404 . drwxr-xr-x 48 root 1024 Aug 1 0430
.. -rw------- 1 ari 2425 Mar 12 1159
.login -rw-r--r-- 1 ari 2425 Mar 12
1159 moshe drwx------ 2 ari 512 May
13 0330 progs
user
group
other
40????? ?????? ?????
---------
--x------
gtchmod ux file
rwxr-xr-x
rwxrwxrwx
gtchmod g-w,o-w file
r--r--r--
gtchmod r file
rwxr-xr--
gtchmod urwx, grx, or file
41?????? ???????
- Execute ????? ????? ???????
- Write ????? ?????/????? ????? ???????
- Read ????? ????? ?? ????? ??????
gt ls -al drwxr-x--- 14 ari 1536 Aug 5 1404
. drwxr-xr-x 48 root 1024 Aug 1 0430
.. -rw------- 1 ari 2425 Mar 12 1159
.login drwx------ 2 ari 512 May 13 0330
progs
???? d ????? ??? ??????
42?????? ??????? ?????? ?????? ?? ??????
- Execute ????? ????? ???????
- Write ????? ?????/????? ????? ???????
- Read ????? ????? ?? ????? ??????
gtcd dir
gtmkdir directory
gtrmdir directory
gtls
43?????? ???????? ??????
- more ltfile namegt
- less ltfile namegt
- man ltcommand namegt
gtmore prog2.c
????? ???? ?? ???? ?? ????? ???? ?? ??
????? ???? ????? ?? ?????
gtman lsgtman man
44?????? C ?????? ?-Unix
include ltstdio.hgt int main() printf
("Hello world \n") return 0
- ?????? ???? hello.c ????? ???? ?????
gtgcc hello.c o hello
2. ?????? (???????) ?? ????? hello.c ???? ????
???? hello
3.?????? ?? ???? ????? hello
gt./helloHello worldgt
45?????? C ?????? ?-Unix
- ?????? ????? ?? ??? ???? ?? ???? ????? (???? ????
?????? ???????? . ??? ) - ?? ?? ??????? ?? ??? ???? ?? ???? ?????, ??????
???? ????? ????? ???? -
gt /usr/uri/progs/hello gt /progs/hello gt./hello
gt hellohello Command not found.
46?????? C ?????? ?-Unix
- ??? ?????? ??? ????? ?? ?????, ?? ????? ?? ??????
???? - ?????? ???? ???????? ?????? ?????? ?? C-shell
gt set path(path .)
47????? ????????? gcc
- ????? ????? ????????? gcc ?????? ?? t2.
- ????????? ?????, ????? ???? ??????, ???? ???? ???
.a.out ??????, ?????? ???? ?????? ?? ?????
file.c - gt gcc file.c
- -o ltdestination namegt ??????? ???? ?????
????????? ????? ????? ??? ??? ??? - gt gcc file.c -o my_prog
- -g ??????? ???? ????? ????????? ?????? ????? ????
???? ????? ?-debugger (?????? ?????? ?? ????????) - gt gcc file.c -g -o my_prog
- ???? ?? ????? ???? ???? ??? ????? ???? ????
- gt gcc file1.c file2.c file3.c -o my_prog
48????? ????????? gcc
- ???????? ????? ?????? ????????? ?????? ?? ???
??????? (warnings) ???????? - -Wall
- -pedantic-errors
- gt gcc -Wall -pedantic-errors file.c -o my_prog
- ??????? ????? ?????? ?? ????? ?????? ???????????
???????? - ????? ??????? ????? ??????? ??????
- ???? debugging ????? ??? ?????? ???? ???
- ???? ???? ????? ????? ?? ?? ??????? ?? ?????????
- ?? ??????
- ?? "??????"
- ?? ???? ????? ???? ??? ????? ?? ?? ????? ??????
49????? ?????? ?? t2, gcc, debugger