Beruflich Dokumente
Kultur Dokumente
The aim of this guide is to help people to start using the facilities available on the Unix and Linux servers managed by Information Services. It refers in particular to the general purpose Unix server granby. The information in this Guide is also helpful if you are using other Unix/Linux servers.
Contents
1. Servers...........................................................................................................1 2. Username and password..............................................................................1 3. Software for connecting to Unix/Linux hosts ............................................1 4. Text-based (command line) interface via SSH ..........................................2 Multiple sessions....................................................................................5 5. Text-based (command line) interface via SSH with Exceed running in background.................................................................................................5 6. Windows style desktop on granby..............................................................5 Points to note about using the desktop...................................................7 Basic features of the KDE desktop ........................................................7 7. File permissions a brief description.......................................................9 8. Selecting groups of files by pattern matching ...........................................9 9. Transferring files between the server and a PC......................................10 10. Help information......................................................................................10
1. Servers
Information Services provides a Unix server known as granby for general type of work, a Linux (64 bit) server known as caunton for running specialized applications requiring intensive computing power, and also some Unix workstations in various locations. The term Unix Service in this Guide refers to all of these collectively. IS also provides access to a High Performance Computing (HPC) facility using Linux servers. This Guide refers mainly to granby, but much of the information in it is also applicable to the other servers mentioned above. You can check the availability of software on the Unix service and the HPC from the applications web page on the IS website at the link: www.nottingham.ac.uk/is/services/software/
A text-based interface via SSH. The keyboard is used to enter commands and the remote host returns the results only in text form. The mouse cannot be used for input to the remote host, and no graphical output can be displayed. A text-based interface via SSH but with the addition of Exceed running in the background. This works as above, but now the host can launch windows to display graphical output from programs. A Windows style desktop via Exceed. This provides a fully-featured graphical desktop running on granby. Other hosts can be accessed through this desktop.
If you are connecting to a University Unix/Linux server, such as granby, from outside the University, you may have to use a text-based interface as in the first method above, since it may be impossible or impractically slow to use graphical displays. A text-based interface is also preferable for short sessions.
Press Quick Connect and in the resulting Connect to Remote Host window: a) Type granby in the Host Name box (from off-campus you will need to type the full address granby.nottingham.ac.uk) b) Type your unix username in lower case in the User Name box
c) Press Connect. d) In the window which appears, enter your password. (To delete what you have typed, you can use the back space key or highlight your input with the mouse and press delete.) (Note: You can also connect to caunton or an HPC clone by typing the appropriate host name.) After logging in to granby, you can practise with the following commands in order.
Command: pwd Comments: Stands for print working directory. Displays path of current directory. Initially will show home directory path: /home/username Lists the contents of your current directory. Initially it will be empty. This starts the text editor pico. Use this to create a file in your home directory, called, say, beeston.txt After creating and saving a file, try the ls command again. This is an example of an option with a command. The l option of the ls command produces a long list with more information about each file. Stands for make directory. Creates a new directory. For example: mkdir green creates a directory called green in the current directory. This is an example of a parameter (green) with a command (mkdir). Now with a file and a directory in the home directory, try the commands ls and ls -l. Stands for change directory. Changes the current working directory. For example: cd green makes green the current working directory. Now try the pwd command and the output will be of the form: /home/username/green To change back to the home directory, use the command: cd .. The .. (two dots) stands for the parent directory and this command changes to the directory containing the current directory. Note that the command cd without any parameter always changes to the home directory. Stands for copy. It takes two parameters and copies an existing file into another one. For example: cp beeston.txt dunkirk will create a file called dunkirk with the contents of the file beeston.txt. (If a file with the name dunkirk already existed, it would be replaced by the new file.) If the second parameter is a directory, the file is created in that
ls pico ls ls -l mkdir
ls and ls -l cd
pwd cd
cp
directory. Thus: cp beeston.txt green will create a file in green called beeston.txt as a copy of the file beeston.txt in the home directory. The command: cp beeston.txt green/city.txt will create a file in green called city.txt as a copy of the file beeston.txt which is in the home directory. ls -l Try ls -l in the home directory. Change to the directory green (using cd). Try ls -l in this directory. Change back to home directory. Try ls in the following form: ls -l green This is an example of a command with an option l and a parameter green. Stands for move. It takes two parameters and moves (or renames) a file to the new name. For example: mv dunkirk radford will, in effect, rename the file dunkirk as radford. It can also be used in the following forms: mv radford green which moves the file radford to the directory green with the name radford. You can give the moved file a different name by issuing the following command: mv radford green/hyson This would move the file radford to the directory green and give it the name hyson. rm stands for remove. Deletes a file. With option -i it prompts for confirmation before deleting the file. The rmdir command deletes a directory, but only if the directory has been emptied. The ls command also has an option t which causes the files to be listed in time order, with the latest appearing first in the list. Adding the option r reverses the order of the list. To see the effect, first create two files in this order: cp beeston.txt a1 cp beeston.txt z9 Now try the following three commands and check the order of the list: ls -l ls -lt ls -ltr This is used to change your password. The password must be at least 6 characters long and in addition to alphanumeric characters also contain at least one non-alphanumeric character. This is used to end your session. You can also press ctrl-d.
mv
rm and rmdir
passwd
logout
You can also end your session by doing disconnect in SSH. This is found in the File menu as well as on a button on the toolbar.
Multiple sessions
Within an SSH session to a host, you can launch another session to the same host by selecting Window from the top menu bar and then selecting New Terminal. There is also an icon for it in the toolbar. With two sessions, you could, for example, view the contents of two different directories in different windows.
5. Text-based (command line) interface via SSH with Exceed running in background
In addition to logging in via SSH as above, launch Exceed for SSH. This icon is in the same NAL folder (Accessing the Internet). When it is running, all you will notice is the presence of the Exceed tab in the Windows Task Bar. Now issue the command xclock. An X window will open, displaying a clock showing the current time. The following actions can be performed on this window using the mouse: moving, resizing, minimizing, maximizing, and closing. The following are some commands which run graphical applications or utilities on granby that you can issue and see the effect: maple -cw nedit bluefish kview firefox a mathematical application an editor for text files an editor for html files viewer for graphical images a World Wide Web browser
To close Exceed, right-click on the Exceed tab in the Windows Taskbar and select close.
2. Then the following welcome screen appears, in which you type your username and click OK (or press Enter):
3. On the next welcome screen, before typing your password, you must first select the KDE 3 desktop. This is done as follows: a) Press and hold the Options button to display the drop-down menu. b) Bring the mouse pointer down to Session. c) In the right-hand menu that appears, click on KDE 3. d) Now make sure that the KDE 3 logo has appeared in the box on the right of the login window.
You will see the screen shown above as you perform the last step in selecting the KDE 3 desktop. Note that selecting the KDE 3 desktop is only necessary the first time a username logs in. On subsequent logins under that username, KDE 3 will be selected by default. After this, type your password and click OK (or press Enter). 2. When you launch this desktop for the first time: a) The Welcome to KDE 3 screen appears. We suggest that you select Skip Wizard on it, and then Quit and Keep on the next screen in order to close this wizard. b) After the desktop launches, two further information windows are displayed. You can close these as well. c) Now you are looking at the desktop. The black background is printed with guidance on how you can change the wallpaper to something you like.
6 Tutorial Guide to the IS Unix Service
K Application Starter
Control Centre
Home
Xterm
Desktops
K Application Starter button: This displays a pull-up menu whose items have further sub-menus. Everything you can do in the desktop is contained within these menus. The other buttons are short cuts to commonly required actions. Control Centre button: Launches the Control Centre which is used to customize the desktop. Practise with changing the wallpaper as follows through the Control Centre: 1. 2. 3. 4. Expand Look & Feel. Under it, click Background. Select Wallpaper tab. Click the down-arrow in the line beginning Wallpaper. A list of image filenames is displayed. 5. Take the mouse pointer to any filename and the corresponding image will be displayed in a box above it (which looks like a monitor screen). 6. Click on the desired filename to select it. 7. Press the Apply button at the bottom to apply the wallpaper. With the Control Centre still open, practise with the window controls of moving, resizing, minimizing and maximizing this window. XTerm button: Launches a text-mode window, similar to the text-based interface you used earlier, in which you can issue Unix commands. If you issue a command to run a graphical application or utility, a window will open displaying the graphical output, in which you can use graphical features.
You can also connect to other servers (e.g. caunton or an HPC clone) from an XTerm window by using the ssh command, for example: ssh caunton Desktops: By default KDE3 creates four desktops. Selecting the buttons labeled 1, 2, 3 or 4 brings up the corresponding desktop. You can vary the number of desktops available by going to: Control Centre > Look&Feel >Desktop and selecting the tab Number of Desktops. Home button: This launches a file manager whose appearance is shown below.
Note with the following features: Location line shows which folders contents are being displayed. A tree view of folders is in the left column. In the main window, files and folders are represented by appropriate icons. This iconic view can be changed to the Detailed List view by buttons on the toolbar as well as by the menu selection View > View Mode. Files and folders can be filtered, i.e. only those of a certain type displayed, by going to Tools > View Filter. (To see all contents again, select Reset.) Left-click on a file to view its contents. Note change in the path in Location. The up-arrow or the left-arrow in the toolbar can be used to return to the parent folder or the last folder respectively. Right-click on file to see a drop-down menu of actions on the file (New Window to open it in an editing window, rename, delete, copy, etc.) Left-click on a folder to view its contents. Right-click on a folder and select New Window to open it in a new file manager window. Now drag and drop files from one window to the other and, when dropping, select copy or move in the destination folder. Files and folders can also be dragged to the desktop and placed on it as links (short cuts).
Right-click in the background of the contents window to display a drop-down menu to select an action (e.g. Create New to create folder or file).
Panel: Buttons on the panel can be removed or moved by right-clicking on a button and selecting the appropriate action. The Panel can be configured by, for example, adding buttons for other applications. To do this, either right-click on an empty part of the Panel or press the K button and select Configure Panel in the pull-up menu. To log out from Exceed, press the K button and select the bottom item in the pull-up menu called logout. There is also a button for it towards the right hand end of the Panel. Do not simply close the Exceed application in Windows XP.
Each category can be assigned any combination of rwx permissions. Permissions on files can be seen by issuing the command ls -l and looking at the set of characters in the first column. They are also displayed in the Home file manager if the Detailed List view is selected. If you want files within a directory under your username to be readable by others, then you must give the directory x and r access as well as r access to the files. If you are managing webpages then all files that you wish to be accessible to people from a web browser must be made readable to the category of other. The unix command to change permissions on files and directories is: chmod
The echo command can be used to list the names that match a pattern. For example: echo *.txt
A pattern can be used for names when issuing commands as in the examples below: cp *.txt green copies all *.txt files from current folder to the folder green rm bc* deletes all files in current folder whose names begin with bc chmod a=r * sets read permission for everyone on all files in current directory.
will display the entry for the ls command. The listing of the entry pauses when the screen becomes full. Press Enter for the next screenful or press q to quit. In the man entry you can find out from the Options section which options are available with that command and what effect they have. There is an Examples section near the end of the entry giving some examples of how to use the command. To use the man command you have to know the name of the command about which you require information. If you want to find out the name of the command that performs a certain action (e.g. delete a file), there is a command available on granby called howto. For example, the commands: howto delete howto copy
will, in each case, list names of Unix commands that can perform those actions.
10