cd ~/Shell
echo $SHELL
which csh which tcsh which ksh which bh which bash
sh csh ksh bash ps
exit exit exit exit ps
man ps
ps ps uc ps ug ps aux
man kill
sleep 5000Now try issuing some other commands, for example ls. What happens? Why won't the shell accept any commands?
sleep 5000 &Now try issuing some other commands, for example ls. What happens?
Start a couple more sleep 5000 processes in the background and then use the jobs command again. Do they all appear?
% ps PID TTY TIME CMD 15493 pts/0 0:00 sleep 1000 18054 pts/0 0:00 sleep 1000 18309 pts/0 0:00 -tcsh 27017 pts/0 0:00 ps % kill 15493 18054 % ps PID TTY TIME CMD 15498 pts/0 0:00 ps 18309 pts/0 0:00 -tcsh [3] + Terminated sleep 1000 [2] + Terminated sleep 1000
man cp > cp.manpageList your directory to confirm that the command worked. View the file with the more cp.manpage command also.
ls -l ~/* > homedir.files
mail studntXX@nodeX.class.mhpcc.edu < homedir.files
ls * nosuchfile >& ls.out-err
echo 'one' > file1 cat file1 echo 'two' > file1 cat file1
echo 'one' > file1 cat file1 echo 'two' >> file1 cat file1
sort < unsorted > sorted.list
who | sort
ps ug | more
ps ug | grep studnt
ps ug | grep root | more
history -r | more
% history -r more 36 12:34 cat sorted.list 35 12:34 sort < unsorted > sorted.list 34 12:34 ls -l > unsorted 33 12:32 sort < ls * > sorted.list 32 12:23 ps ug | grep studnt 31 12:22 ps ug | grep root | more 30 12:20 ps ug | more 29 12:18 ps aux 28 12:16 ls % !36Now try reexecuting an event by using the !string method. For example, the command !his will reexecute the last command you issued which began with the string "his" (such as a history command).
Finally, try reexcuting a previous command by typing !!
sort unsrted | grep SystemsAfter the shell tells you it can't open the file "unsrted", modify the command as shown below. The command should now work.
^srt^sortUsing the Tcsh, you could also accomplish this by recalling the command with the up arrow key and then editing the command line.
alias h "history -r | more" h alias ll "ls -l" ll alias rm "rm -i" rm unsortedIssue the alias command without any arguments. It should show you all of your defined aliases.
ls ~/Filesystem/* ls ~/Filesystem/file* ls ~/Filesystem/[ns]*You can turn off filename generation with the command set noglob. Do this and then try the same commands above. When you're convinced that it is turned off, turn it back on again with the command unset noglob.
touch Introduction.UNIX.FilesystemsNow, type the following and notice what happens. Note that you should use the actual Tab key instead of the literal words "Tab key". Also note that some systems use the Esc key instead of the Tab key.
ls IntTab key
echo $user echo $home echo $term
echo $path echo $path | fold - use this if it "runs off" the right hand side of the screen
echo $HOST echo $MANPATH echo $HOME
ls -l $HOME echo My userid is $user and my machine is $HOST
set myvar1 = "this is a string variable" echo $myvar1 setenv dir1 /usr/local/bin ls $dir1 set colors=(red green blue) echo $colors[1] echo $colors[2] echo $colors[3] echo $colors @ num1 = 256 @ num2 = 512 @ num3 = ($num1 + $num2) echo $num3
unset colors echo $colors unsetenv dir1 echo $dir1
cd ls -a