120 likes | 222 Views
Next Unix Topics. Tuesday, 2/11 & 18/2014. Change Password (by 2/14/14). s sh to account on faclinux.cse.ohio-state.edu stdlinux.cse.ohio-state.edu passwd Then follow prompts Questions or issues, call CSE Help Desk at 292-6542. How to print a file directory.
E N D
Next Unix Topics Tuesday, 2/11 & 18/2014
Change Password (by 2/14/14) • ssh to account on • faclinux.cse.ohio-state.edu • stdlinux.cse.ohio-state.edu • passwd • Then follow prompts • Questions or issues, call CSE Help Desk at 292-6542
How to print a file directory • Directories are not printable in Windows and MacOS X • do a directory in Unix • redirect output to file • print that file
Print Directory • ls –la • To display directory • ls –la > temp • To redirect output to file • ls –la | temp • Won’t work because piping requires a program • To pipe to another program, so • ls –la | cat
Start a Web Page • Working between your own machine and CSE machine mkdir, rmdir, rm, cat, chmod 644, some simple HTML • Basic Web page - HTML <html> <head> <title>4251 Sample</title> </head> <body>sample text<br/> more text </body> </html> • To copy a file (this one) from my Mac to faclinux to be on my web page: • Bobs-MacBook-Air:~ bobmathis$ scp -r ~/Desktop/CSE4251_Sp14.doc <same line> bmathis@faclinux.cse.ohio-state.edu:WWW/4251/CSE4251_Sp14.doc • Then update file permissions.
Alias • Typing the command alone, shows what exists • dir alias ls –la
Entering & Editing Text • emacs, vi, pico or nano • pico is the editor I use – because it is simplest • vi has two modes – entering text and editing it • emacs is most powerful • Choose what suits you andwhat your friends are using
vi • vim – vi Improved • vi <file-name> • :x exit (save changes & quit) • :q! quit without saving • :w write file • :w <file> write <file>
emacs • Ctrl-x Ctrl-w write file • Ctrl-x Ctrl-c save-buffers-kil-emacs
Shell Scripts • Writing programs at operating system level • First trial script: #! /bin/bash # This is our first script. echo "Hello World!"