ACC681

internet commands, DOS, unix, and shell script

Internet commands (for all platforms in general)

telnet host / connect to another Internet site
ftp host / connect to a FTP site and transfer files between computer systems
nslookup systemNameOrIp / check ip address
ping systemNameOrIp / check if a machine is up and running
archie filename / search the Archie database for a file on a FTP site
lynx url / a textual World Wide Web browse
finger emailAddress / show more information about a user
gopher / a gopher database browser

DOS commands (not case sensitive; available in Win95/98/2000 by clicking at the MSDOS icon)

dir / show contents of current directory
mkdir or md newDirectory / make new directory
del fileOrDirectoryName / delete file or directory
cd destination / change directory
help command / show help on a specific command
type file / display contents of a file
copy oldfile newfile / copy a file
ren oldfile newfile / rename a file
batch files
similar to Unix shell scripts / 1. save file with the .bat extension
2. can run a batch file by typing its filename

Unix commands (case sensitive; available on Unix platform)

clear / clear screen
ls / show directory, in alphabetical order
logout / log off system
mkdir newDirectoryName / make a directory
rmdir directoryName / remove directory (rm -r to delete folders with files)
rm filename / remove files
cd destination / change current directory
man command / show help on a specific command
talk user / page user for chat - (user) is a email address
write user / write a user on the local system (control-c to end)
pine / easy to use mailer
mail / mail -s "A game of tennis today?" joe < message
more file / view a file, pausing every screenful
cat file / concatenate and display resulting file
passwd / change your password
grep / search for a string in a file
find / find a file/directory
tail / show the last few lines of a file
who / show who is logged into the local system
w / show who is logged on and what they're doing
df / show disk space available on the system
du / show how much disk space is being used up by folders
uname -a / show version of unix and processor type information
chmod / change permissions on a file
gcc file.c / compile C source into a file named 'a.out'
pwd / display absolute name of current working directory
mv oldName newName / rename file
cp oldName newName / copy file
lpr file / send file to line printer; print file
sort file / sort lines of a file
psrinfo -v / processor information such as cpu speed
/usr/local/etc/top / info about top cpu processes on cpu used, memory used, swap available
^c / control-c to quit a running process
nohup / nohup /db5/bin/j2ee/j2sdkee1.3.1/bin/j2ee &
Keep process running even after user logs out.

C Shell Script

Unix C-shell Shell script

/ 1. The first line must begin with the string #!/bin/csh.
2. Use ‘chmod u+x filename’ command to give yourself execution permission.
3. Run the shell script by typing its filename.

Example 9.76 (Quigley 387)

#!/bin/csh

echo -n "What is your name? "

set name = $<

echo Greetings to you, $name.

Running Example 9.76 (Quigley 387)

acunix1% chmod u+x greet

acunix1% greet

What is your name? Tam

Greetings to you, Tam.

acunix1%

Running Example 9.76 (Quigley 387) after invoking the script command -- Typescript file to record interaction

acunix1% script greetScript

Script started, file is greetScript

acunix1% ls -l greet

-rwx------1 tam faculty 86 Sep 11 14:22 greet

acunix1% cat greet

#!/bin/csh

echo -n "What is your name? "

set name = $<

echo Greetings to you, $name.

acunix1% greet

What is your name? Java

Greetings to you, Java.

acunix1% exit

acunix1% Script done, file is greetScript

acunix1% ls

Get10k ceoLet1Front.doc greet public_html

Get10k.c client greetScript rmi

Mail cloudscape.LOG hw1 tmp

acunix2% more greetScript

Script started on Wed Sep 11 14:38:47 2002

acunix1% ls -l greet

-rwx------1 tam faculty 86 Sep 11 14:22 greet

acunix1% cat greet

#!/bin/csh

echo -n "What is your name? "

set name = $<

echo Greetings to you, $name.

acunix1% greet

What is your name? Java

Greetings to you, Java.

acunix1% exit

acunix1%

script done on Wed Sep 11 14:39:35 2002

acunix2%

Unix Shell

Kernel Layer: The inter most layer of the operating system software. It is the only layer that interacts directly with the hardware.

Service Layer: Accepts service requests from the command layer and translate them in to detailed instructions to the kernel

Command Layer (or the Shell): The outermost layer. Provides the user interface. It is the only part of the operating system which users can interact directly.

merge pine folders / Start Pine.
Open the folder DAVE, using the L or G commands.
For each message in turn in the DAVE folder, save it to the folder dave by means of the S (save) command. When prompted for the folder name, type dave.
If you have many messages in the first folder, here is a quicker way of saving them all in one go to the other folder:
Open the folder you want to copy from, using the L or G commands, as above.
Type a semicolon (;) - this command means select.
Type A which means 'All'. The net effect is to 'select all messages' in this folder.
Type A again, which now means 'Apply'.
Type S, meaning 'Save'. (We are applying the Save command to all the selected messages)
Now enter the name of the folder to which you want the messages saved. The messages will then be appended to the other folder, and marked for deletion from the first folder.
Please take care not to allow your mail folders to grow too large.
Making sorting temporary / Move /home2/f/t/tam/Mail/sent
In Mail folder, open INBOX and use $ Date to sort INBOX.
Use ;aas to select, all, apply; and save. Specify destination /dept/acct/tam/allmsg
Move /home2/f/t/tam/Mail to /dept/acct/tam/Mail for extra space
Move allmsg to /dept/acct/tam/Mail/allmsg.
In pine, goto Setup and collectionList. Change Mail path from Mail/ to /dept/acct/tam/Mail/ so that Mail folder contains default INBOX and allmsg.
Open INBOX, use ;aad to delete all messages.
Open allmsg, use ;aas to save all messages to INBOX. Take 10 mins for 7k msgs.
Reset Mail path from /dept/acct/tam/Mail/ back to Mail/.

1