Unix_Workshop_part3.doc

advertisement
MCSR Seminar on UNIX Part 3
1.
Getting Started
o Logging on to the system
i) Start the secure shell client:
Start->Programs->SSH Secure Shell->Secure Shell Client
ii) Connect to willow:
From the secure shell window, click Quick Connect.
Then, from the Connect to Remote Host pop-up window, enter:
Hostname: willow.olemiss.edu
User Name: student
and click Connect.
iii) Enter your password in the popup window.
2) Listing files and creating directories:
pwd
(Print the name of your working directory)
ls
(List the files in your working directory)
cd dir_no
(Change directory to the numbered directory assigned to you)
pwd
(Print the name of your working directory…what is it now?)
mkdir workshop
(Make a new subdirectory under your home dir called workshop)
cd workshop
(Change directories to your workshop directory)
3) Copy example files to your workshop directory. (The first time you login only.)
At the willow command prompt, type:
pwd
(Confirm that you are in your workshop directory)
/users/student/.addfile
(Executes Unix script that copies files to your workshop dir)
ls
(Confirm that the two files are there: myunix and welcome)
4) Working with File permissions
chmod supports an alternative way to specify permissions by a 3 digit sequence. The first
digit designates owner permission; the second; group and the third; others permission. Digits
are calculated as a compilation of the following values:
4 read
2 write
1 execute
chmod 777 welcome
umask 002 welcome
(turn on the all the permissions)
5) Useful Commands
cp myunix myunix1
(copy file myunix to myunix1)
vi myunix1
diff myunix myunix1
(Reports lines that differ between file1 and file2)
diff –b myunix myunx 1
(ignores blank spaces and tabs)
find /users/student/ -name myunix
(searches the given path for the specified file)
passwd
(Create or change password)
sort myunix (sorts the lines of the file in alphabetical order)
6) The Shell
echo $SHELL
cat /etc/shells
chsh -s /bin/csh
(value of your default shell)
(all available shell)
(change shell)
UNIX Help for Users
http://www.mcsr.olemiss.edu/unixhelp/
Secure Shell at UM/MCSR
http://www.mcsr.olemiss.edu/computing/ssh2.html
Download