150 likes | 244 Vues
COP3502: Introduction to Computer Science. Yashas Shankar. Basic UNIX commands. SSH to shell.cs.fsu.edu Reviews ls – list cp – copy mv – move (rename) rm – remove (delete) pwd – gives current directory man – gives manual ‘>’ – redirection, create new file
E N D
COP3502: Introduction to Computer Science Yashas Shankar
Basic UNIX commands • SSH to shell.cs.fsu.edu • Reviews • ls – list • cp – copy • mv – move (rename) • rm – remove (delete) • pwd – gives current directory • man – gives manual • ‘>’ – redirection, create new file • ‘>>’ – redirection, append the file, create a file if it does not exist • Emacs – edit text • CTRL-X-S to save • CTRL-X-C to exit
Basic UNIX commands • ls – list files and directory • Try ‘man ls’ to see how to use ls • ls –l list details shankar@diablo:~/COP3502>ls -l total 24 - rw- --- --- 1 shankar CS-Grads 7 Aug 27 15:10 fileone.txt d rwx --- --- 2 shankar CS-Grads 4096 Aug 16 12:02 PROGRAMMING d rwx --- --- 2 shankar CS-Grads 4096 Aug 27 11:39 SLIDES d rwx --- --- 2 shankar CS-Grads 4096 Aug 17 11:08 WEBPAGE d = directory r = read w = write x = execute There are 3 groups of users -you -your group -others
Basic UNIX commands • More on directories • . your current directory • .. one higher directory • ~ your home directory Shell.cs.fsu.edu higher directory shankar home directory COP3502 COPxxxx ppp2131.txt Assume that you are in ~/COP3502 Cd .. move to your home directory Cd COPxxxx move to COPxxxx directory Cd ../COP3502 move to COP3502 directory
Basic UNIX commands • More on directories • . your current directory • .. one higher directory • ~ your home directory Shell.cs.fsu.edu higher directory shankar home directory COP3502 COPxxxx b.txt a.txt a.txt a.txt Assume that you are in ~/COP3502 Cp a.txt ../COPxxxx/b.txt Cp a.txt ../COPxxxx mv ../COPxxxx/a.txt ../c.txt
EXAMPLES Shell.cs.fsu.edu higher directory shankar home directory A C B COP3502_TEMP c.txt a.txt b.txt
EXAMPLES Shell.cs.fsu.edu higher directory shankar home directory COP3502_TEMP A C B a.txt c.txt a.txt cp ~/COP3502_TEMP/C/c.txt ~/COP3503_TEMP/A/a.txt cp /home/grads/shankar/COP3502_TEMP/A/a.txt /home/grads/shankar/COP3502_TEMP/B
EXAMPLES Shell.cs.fsu.edu higher directory shankar home directory COP3502_TEMP A a.txt a.txt cp A/a.txt . cp ~/COP3502_TEMP/A/a.txt . cp /home/grads/shankar/COP3502_TEMP/A/a.txt .
Unix redirection • ‘>’ redirect output to a new file • An existing file will be deleted and created (overwrite) • ‘>>’ redirect output to a file • Append output to the end of the file if the file exists • Create a new file if the file does not exists
How to use Emacs • Emacs filename starts emacs • CTRL-X-S save • CTRL-X-C exit • CTRL-k delete a line (after where the cursor is) • CTRL-y paste the deleted line • CTRL-g cancel • CTRL-x u undo
Assignment#3 • See handout • Due next class
Textbooks • You will need the “The analytical engine” textbook starting from Week4. • You will cover the “Ethics for the information age” textbook in Week13 • You will need this textbooks for the extra credits • How to find textbooks? • FSU bookstore • Bills bookstore • Online
Extra credits • Late assignments are not accepted (you will get zero). There will also not be any make-up quizzes. • You can get those points back by doing extra credits • There are four extra credits. Two will replace two of your lowest homework scores. Another two will replace two of your lowest quiz scores. • One extra credit write a 5 page summary of one chapter in the “Ethics for the information age” textbook • Four extra credits four chapters with 5 pages each • There will not be any other extra credits
Before we leave • Homework#1 dues tonight: send me an e-mail from your CS account • Subject COP3502: Assignment#1 submission • Body your full name • Homework#3 dues next class • Get familiar with UNIX and Emacs • Next class: • C, C++, Java