






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







9/1/2005 3 Department of Com
puter and Informati
on Sciences
Double-click on the SSH Secure File Transfer Client icon
9/1/2005 4 Department of Com
puter and Informati
on Sciences
Press ENTER or SPACEBAR A popup window will appear Enter the hostname and userid in the popup window and click on Connect
9/1/2005 5 Department of Com
puter and Informati
on Sciences
A popup window will appear and prompt for the password Enter your password and click on OK
9/1/2005 6 Department of Com
puter and Informati
on Sciences
The directory structure of the host machine is displayed in the right window
9/1/2005 10 Department of Com
puter and Informati
on Sciences
UAB UNIX ShellUNIX Shell
Unix Command InterpreterUnix Command Interpreter
9/1/2005 11 Department of Com
puter and Informati
on Sciences
Environment VariablesEnvironment Variables
9/1/2005 12 Department of Com
puter and Informati
on Sciences
Shell, userShell, user--defined variables?defined variables?
Customize the environment in which the shell runs and are used for proper execution of the shell commands. A copy of the variables is passed to every command that executes in the shell as its child. Initialized at log on.
Used within shell scripts as temporary storage. Can be made global and passed to the commands that executes in the shell script. Need to be declared before they can be used.
9/1/2005 13 Department of Com
puter and Informati
on Sciences
UAB Setting Environment VariablesSetting Environment Variables
(BASH Shell)(BASH Shell)
Remains until logout or exit from the shell VARNAME=value_of_variableVARNAME=value_of_variable export VARNAMEexport VARNAME Example: (^) EDITOR=vi; export EDITOREDITOR=vi; export EDITOR
Enter change in .bashrc.bashrc or (^) .bash_profile.bash_profile Save the file Enter the command: source ~/.bashrcsource ~/.bashrc or source ~/.bash_profilesource ~/.bash_profile
9/1/2005 14 Department of Com
puter and Informati
on Sciences
UAB Setting Environment VariablesSetting Environment Variables
(C Shell)(C Shell)
Remains until logout or exit from the shell setenv VARNAME value_of_variablesetenv VARNAME value_of_variable Example: setenvsetenv EDITOR viEDITOR vi
Enter change in .cshrc.cshrc Save the file Enter the command: source ~/.cshrcsource ~/.cshrc
9/1/2005 15 Department of Com
puter and Informati
on Sciences
Environment Variables (all sessions)Environment Variables (all sessions)
edit the configuration file for the shell you're running change the environment variable setting of interest save the changes
TC (tcsh) ~/.tcshrc
Z (zsh) ~/.zshrc
Bash (bash) ~/.bashrc, ~/.bash_profile
C (csh) ~/.login, ~/.cshrc
Korn (ksh) ~/.kshrc
/etc/profile*, ~/.profile
Configuration File Bourne (sh)
Shell
9/1/2005 19 Department of Com
puter and Informati
on Sciences
For example: echo $PATH /hf/sol8/grid/bin:.:/bin:/usr/bin:/sbin:/usr/sbin:/hf/sol8/eclipse:/hf/lang/SUNWspro/bin:/hf/lang/ SUNWspro/lib:/hf/local/java/bin:/hf/sol8/SUNWns6:/hf/local/netscape4.76:/hf/local/bin:/hf/lo cal/lib:/hf/local/latex2html:/hf/local/packages.d/aladdin/gs5.50:/hf/local/lib/gcc-lib/sparc- sun-solaris2.6/egcs-2.91.66:/hf/local/lib/g++-include:/hf/local/xemacs- 21.1.6/src:/hc/ra/local/bin:/usr/dt/bin:/usr/dt/lib:/usr/openwin/bin:/usr/openwin/bin/xview
bash /bin://bin:/usrusr/bin/bin csh /bin/bin /usr/bin/usr/bin
“whichwhich” or “whereiswhereis” display the location of the utilities “..” indicates the current directory
9/1/2005 20 Department of Com
puter and Informati
on Sciences
puri@blazer1:~[501]$ PS1='[hostname:date] $ ' [blazer1:Sun Feb 13 19:14:06 CST 2005] $
puri@blazer1:~[501]$ set prompt=‘[%m:%d %w %D %P] $ ' [blazer1:Sun Feb 13 19:14:06] $
9/1/2005 22 Department of Com
puter and Informati
on Sciences
tar (tape archive)tar (tape archive)
tar cvf archive_name.tar [files | directory]tar cvf archive_name.tar [files | directory]
tar tvf archive_name.tartar tvf archive_name.tar
tar xvf archive_name.tartar xvf archive_name.tar
9/1/2005 23 Department of Com
puter and Informati
on Sciences
Other tar optionsOther tar options
tar cvftar cvf - - ls > archive_name.tarls > archive_name.tar
9/1/2005 24 Department of Com
puter and Informati
on Sciences
gzipgzip
gzip filenamegzip filename (a file filename.gzfilename.gz is created and original is removed)
gunzip filename.gzgunzip filename.gz (a file filename is created) ^ gzipgzip^ – –d filename.gzd filename.gz
$ tar cvfz examples.tar.gz examples $ file examples.tar.gz examples.tar.gz: gzip compressed data, from Unix $ cp examples.tar.gz /tmp/ $ cd !$ $ gunzip -c examples.tar.gz | tar xvf -
9/1/2005 28 Department of Com
puter and Informati
on Sciences
Inserting textInserting text
Insert at the current cursor position press “ii” Insert after the current cursor position press “aa” Insert at the start of the current line press “II” Insert at the end of the current line press “AA” Insert a line above the current line press “OO” Insert a line below the current line press “oo”
9/1/2005 29 Department of Com
puter and Informati
on Sciences
Moving around (I)Moving around (I)
Right ll (→) Left hh (←) Up (^) kk (↑) Down (^) jj (↓) A number before the above commands will move the cursor by the number of characters specified (4h4h – move cursor 4 characters to the left from current position) To move to a specific line use: nGnG where n is the specified line number CTRLCTRL--GG will indicate the current line number and the total number of lines in the file To move to a specific target use: /
9/1/2005 30 Department of Com
puter and Informati
on Sciences
Moving around (II)Moving around (II)
Scroll up by a page CTRLCTRL--FF down by a page CTRLCTRL--BB up by half a page CTRLCTRL--UU down by half a page CTRLCTRL--DD Move to the start of the current line (^) ^^ or 00 (number zero) end of the current line $$ start of the previous line – – (minus sign) start of the next line (^) ++ Move to the start of next word ww (n words forward – nw) start of previous word bb (n words backward – nb) end of current word ee (end of n words – ne)
9/1/2005 31 Department of Com
puter and Informati
on Sciences
Other CommandsOther Commands
Undo last text-change action uu Undo all changes made to the current line UU (assumes that you have not move the cursor from that line) Repeat last text-change action .. (period) Delete Character(s) xx or nxnx Word(s) dwdw or ndwndw Line(s) dddd or nddndd Replace Character rr Word cwcw (mode change) Line (mode change) SS or cccc (from the start of current line) RR or CC (from current cursor position)
9/1/2005 32 Department of Com
puter and Informati
on Sciences
Using Pico (I)Using Pico (I)
Move to end of line CTRLCTRL--EE Move to beginning of line CTRLCTRL--AA Cut/delete current line (also puts the line in a buffer so it can be undeleted/pasted) CTRLCTRL--KK Undelete/paste the most recently cut line CTRLCTRL--UU Mark a block of text (^) CTRLCTRL--^^ (hold down CTRLCTRL, (^) SHIFTSHIFT and the 6 key, then use the arrows to create the highlighted block) Delete current character (^) CTRLCTRL--DD Justify/rejustify margin CTRLCTRL--JJ Insert existing file into file you're editing (^) CTRLCTRL--RR
9/1/2005 33 Department of Com
puter and Informati
on Sciences
Using Pico (II)Using Pico (II)