Presentation is loading. Please wait.

Presentation is loading. Please wait.

Nick Geoghegan1 Introduction to Linux Workshop. Nick Geoghegan2 Getting Started Download the following files:

Similar presentations


Presentation on theme: "Nick Geoghegan1 Introduction to Linux Workshop. Nick Geoghegan2 Getting Started Download the following files:"— Presentation transcript:

1 Nick Geoghegan1 Introduction to Linux Workshop

2 Nick Geoghegan2 Getting Started Download the following files: http://www.compsoc.nuigalway.ie/links/downloads/files/putty.exe http://www.compsoc.nuigalway.ie/links/downloads/files/winscp3.exe Save them to a directory on your U: drive so that the programs will be accessible no matter what computer you use to login from.

3 Nick Geoghegan3 PuTTY...? In really simple terms: When you run PuTTY on a Windows machine, and tell it to connect to (for example) a Unix / Linux machine (like we will!). PuTTY then opens a window and anything you type into that window is sent straight to the Unix machine, and everything the Unix machine sends back is displayed in the window. So you can work on the Unix machine as if you were sitting at its console, while actually sitting somewhere else.

4 Nick Geoghegan4 Logging In Run PuTTY. Click the “Frink” button When prompted fill in your username and password.

5 Nick Geoghegan5 Directory Structure The linux directory structure is very simple once you get used to it, essentially all files are viewed relative to a single point ‘/’ known as root since it is the start (or root) of all things. /home/users/username is your home directory. For simplicity’s sake you refer to it as ‘~’ (tilde button - on the ‘#’ button)

6 Nick Geoghegan6 Listing Files To ‘navigate’ through your files we’ll start by listing the files that are in your home directory. So when you are logged in, from the prompt just type ls (you’ll see as we carry on that most commands are relatively intuitive, usually just to remove every second letter and sometimes ones that look even vaguely like vowels!) l i s t => ls

7 Nick Geoghegan7 Listing Files You can find out more information about your files by using: ls -l this will show you long filenames and the permissions of the files ls -la this will show you all files including hidden files which won't show up otherwise (they begin with a ‘.’) ls -lh this is human readable and tells you the size of the files in MBs and KBs instead of in bytes.

8 Nick Geoghegan8 Changing Directory Linux files are organized into directories (or folders), you’ll usually have several of these inside your home directory and you can create more as you go along. Use cd ( c hange d irectory) to move through these, ie: cd public_html moves you to public_html directory cd.. moves you down one directory, ie. from home/users/username/public_html to home/users/username cd on its own, typed anywhere, moves you back to your home directory, ie. home/users/username

9 Nick Geoghegan9 Creating / Editing Files You can create / edit text files easily by using several different programs, like nano, vim, etc. I’ll be introducing nano. Simply type nano filename and nano will open the file specified if it exists, and if it doesn’t, then it will create a new file with this name and open it for editing. You can create the file / edit it and use the commands shown at the bottom to save, etc. ie. ^X Exit - press CTRL and X on the keyboard.

10 Nick Geoghegan10 File Manipulation You can use touch file1.txt to create a blank file. You can m o v e ( mv ) and c o p y ( cp ) files easily. Use them as follows: mv file1 file2 or cp file 1 file2 This moves (or copies) the file1 to the location file2. This location can be another file: mv file1.txt myfile.txt This renames file1.txt as myfile.txt cp file1.txt myfile.txt This creates a copy of file1.txt as myfile.txt

11 Nick Geoghegan11 File Manipulation mv file1.txt ~/public_html This moves file1.txt to your public_html directory. cp file1.txt ~/public_html This creates a copy of file1.txt in public_html

12 Nick Geoghegan12 Deleting Files Once you delete something it is gone. There is no recycle bin! So be sure of what you’re doing! To delete ( r e m ove) individual files use rm ie. rm file_name To r e m ove a di rectory use rmdir ie. rmdir mydirectory To remove a directory and all the files in it use rm -r mydirectory (r stands for recursively)

13 Nick Geoghegan13 Creating Directories & Viewing Files M a k ing a dir ectory couldn’t be simpler. Simply type mkdir directoryname And you’re done! To view a file without editing it, just use any of less, cat or more ie. less filename Use up and down arrows to scroll. Press q to quit less

14 Nick Geoghegan14 File Permissions Most of the time it is important to you that your files are private, and that only you can view them, and then there are other cases where you would like for other people to be able to view, but not change your files, i.e. for your website. This is the issue of file permissions. I will just list the ones you need to use, and you can look up the details on the website under “learning” and “documentation”.

15 Nick Geoghegan15 File Permissions Firstly, to make a file in your personal directory private, ie. No one else but you can view or edit the file. Make sure you are in the directory by typing cd Next type chmod 700 filename This gives you access rights of 7 (read, write & execute), and everyone else (group & world users) rights of 0 (ie. can do nothing) But say for example you want to make sure everyone can view your website, then use chmod 755 -R public_html/ This recursively sets the permissions for all files in the public_html directory to be 7 for you, and 5 for everyone else (read & execute, but not edit).

16 Nick Geoghegan16 Who’s Online One of the most useful features, is that you can see at any time who else is online, and what they are doing. Do this by typing who, w or finger It’ll tell you loads of other stuff too, like where they’re logged in from, how long they’ve been online and how long they’ve been idle (doing nothing) for.

17 Nick Geoghegan17 Communication You can write a person a message while they’re online using write username followed by return, then type your message, then press CTRL + C to exit. Or, even better, you can ‘talk’ to them by typing talk username and when they do the same, your window splits and you can type in the top section and see what they type in the bottom section. Again, press CTRL + C to quit.

18 Nick Geoghegan18 Help! So you want some help? Easy, well it is once you know what to do, if you’re wondering how to use a command, just type man command ( man stands for manual pages) This can be a little tricky to get used to, but you should be able to find what you want. Again, press q to quit. info filename can also be useful Also http://www.google.ie/ can be very very useful!http://www.google.ie/ If you’re looking for a program to do something, eg. A calendar try apropos calendar

19 Nick Geoghegan19 You’ve Got Mail You can check your mail from the webmail section of the CompSoc site, but it’s easy and quicker to check it when you are logged into the server. The main program people use to check their mail is mutt. mutt is tricky for newbies, but it is one of the best email clients around. I suggest googling for help! There are so many features that I could devote a whole workshop to mutt!

20 Nick Geoghegan20 Useful Programs wget Downloads files specified to your account. wget http://www.lotsofstuff.com/file1.jpghttp://www.lotsofstuff.com/file1.jpg will save that exact file to your account, and there are lots of settings to save multiple pages at a go! lynx A text-based web browser... irssi A command line irc client

21 Nick Geoghegan21 Password & Quit If you wish to change your password then use passwd You will be prompted to enter your old password and then to enter your new password (twice to make sure you don’t make a mistake). And finally, to get out of PuTTY, you can type exit or logout.

22 Nick Geoghegan22 Transfering Files Now that we have an idea about how to manipulate files on the server, we’re going to use a program called WinSCP to transfer files from your computer to the server. WinSCP will do all basic operations with files, such as copying and moving (to and from a server like we will). It also allows you to rename files and folders, create new folders, changing the properties of files and folders, and creating symbolic links and shortcuts

23 Nick Geoghegan23

24 Nick Geoghegan24 Transfering Files The layout is quite simple: The left-hand side shows your computer and the files on it. The right-hand side shows your account on rivieria Transferring files is just a matter of selecting and pressing F5 to copy (or you can drag and drop). You can create new directories by pressing F7 once you have click on the appropriate side.

25 Nick Geoghegan25 public html Just as a side note, any files you have stored in public_html are accessible to the public, this is where you would upload your website. http://www.compsoc.nuigalway.ie/~username/ Sometimes you may have problems viewing some files, this could be because your “permissions” are set incorrectly. We talked about howto correct this is an earlier section.

26 Nick Geoghegan26 Mailing Lists CompSoc has several different mailing lists for different purposes: compsoc-announce - for announcements about events compsoc-discuss - for all sorts of computer discussion compsoc-technical - for technical announcements

27 Nick Geoghegan27 Conclusion Hopefully at this stage you have some idea of the things that you can do on the server. But, just in case you forget this workshop will be available to download and view in your own time from the compsoc website, check under “learning” and “online workshops”. But if you are having problems then check this file, and then look at the “documentation” or “FAQ” section under “learning”. If that fails then feel free to email me at number6@compsoc.nuigalway.ienumber6@compsoc.nuigalway.ie and I'll try to get you sorted


Download ppt "Nick Geoghegan1 Introduction to Linux Workshop. Nick Geoghegan2 Getting Started Download the following files:"

Similar presentations


Ads by Google