Jump to content

Unix Intro: Difference between revisions

1,848 bytes added ,  15 November 2009
no edit summary
No edit summary
 
(8 intermediate revisions by 4 users not shown)
Line 6: Line 6:


Ok, when you first start using Redbrick and you log on, you'll be looking at a screen which looks fairly plain with some basic instructions for reading mail, news, chat, etc. This is great when you're starting off, but after a while, you'll find that just staring at the screen can hurt your eyes, so you'll want to do other stuff. You'll then see why a lot of people type stuff when using computers. The way that most people prefer when they get used to it, is typing in commands in a 'shell'. This sounds really difficult, but you'll soon get into the hang of it and be heying your friends and going into chat and mailing your ma and so on :o)
Ok, when you first start using Redbrick and you log on, you'll be looking at a screen which looks fairly plain with some basic instructions for reading mail, news, chat, etc. This is great when you're starting off, but after a while, you'll find that just staring at the screen can hurt your eyes, so you'll want to do other stuff. You'll then see why a lot of people type stuff when using computers. The way that most people prefer when they get used to it, is typing in commands in a 'shell'. This sounds really difficult, but you'll soon get into the hang of it and be heying your friends and going into chat and mailing your ma and so on :o)
== Changing your shell ==
The default shell that you start with is zsh, if (for whatever reason) you wish to change your shell here's how to do it.
At the prompt type chsh, like so:
[[Image:chsh1.jpg]]
You'll be asked for your password, enter it. Now you'll be looking at this:
[[Image:chsh2.jpg]]
This shows your current shell and is where you select your new one.
Now you'll need to give it the location of the shell you want to use. If you don't know where they are, don't worry here's a list by typing "help chsh":
[[Image:shells.jpg]]
Now all you do is select the one you want, type it in and away you go.
[[Image:chsh3.jpg]]
As it says, this can take effect immediately or in several minutes time.


== Directory Structure in Unix ==
== Directory Structure in Unix ==
Line 40: Line 64:


  cd ~
  cd ~
However, cd on its own should do the same thing.
cd


=== Your current/parent directory ===
=== Your current/parent directory ===
Line 58: Line 86:


== Basic Unix commands ==
== Basic Unix commands ==
=== apropos & man===
These are arguably the two most useful UNIX commands.
The 'man' command brings up a manual on a command. There is a man page for pretty much every command (although quality of the pages differ vastly). Here's an example:
[[Image:manpage1.png]]
And the result will be:
[[Image:manpage2.png]]
You can navigate through the man page with arrow keys or page up/down.
The 'apropos' command searches through descriptions of man pages based on a keyword.
Lets say you forgot how to rename a file, or just simply didn't know how to to begin with you can type:
[[Image:apropos1.png]]
and the result will be:
[[Image:apropos2.png]]
Simple (and really useful too).
=== creating files ===


Say you wanted to create a file in your home directory called 'phonenumbers'. You need to use an editor. The editor on Redbrick that is the best to use when you're starting off, is nano. In fact, lots of experienced users still use it. So, to create your file, you would type:
Say you wanted to create a file in your home directory called 'phonenumbers'. You need to use an editor. The editor on Redbrick that is the best to use when you're starting off, is nano. In fact, lots of experienced users still use it. So, to create your file, you would type:
Line 75: Line 132:
The command 'ls' simply lists all your files in the folder that you are in, One point, there can be 'hidden' files in a folder. Their names begin with a "." They aren't really hidden, it's just that ls won't see them, unless you tell it to look for them by using the command:
The command 'ls' simply lists all your files in the folder that you are in, One point, there can be 'hidden' files in a folder. Their names begin with a "." They aren't really hidden, it's just that ls won't see them, unless you tell it to look for them by using the command:


  ls -a
  ls -A


This will show ALL files in that folder. Another 'argument' that you can pass ls, is the l option, which gives a detailed listing of the files, and you can specify more than one argument to ls, or any other command for that matter. The command:
This will show ALL files in that folder. Another 'argument' that you can pass ls, is the l option, which gives a detailed listing of the files, and you can specify more than one argument to ls, or any other command for that matter. The command:


  ls -al
  ls -Al


will give a detailed listing of all files in your current folder, including 'hidden' files.
will give a detailed listing of all files in your current folder, including 'hidden' files.
ls -Alh
will show the same listings with "human readable" file sizes, instead of bytes.


=== cd ===
=== cd ===
Line 183: Line 244:


to get detailed instructions on that command. The best way to learn Unix is to experiment, just be careful when you're going around deleting stuff. :) This is just a primer for those of you starting off on Unix, but there are numerous tutorials on unix to be found on the web and you can always talk to [[Helpdesk]] if you have a problem or a question.
to get detailed instructions on that command. The best way to learn Unix is to experiment, just be careful when you're going around deleting stuff. :) This is just a primer for those of you starting off on Unix, but there are numerous tutorials on unix to be found on the web and you can always talk to [[Helpdesk]] if you have a problem or a question.
=== clear ===
Oh, one other thing: the clear command.
If your screen is filled up with text or program you've quit out of and are basically just in the way you can clear your screen like so:
[[Image:clear.jpg]]
And you'll be left with this:
[[Image:clear2.jpg]]
Yay.


== Links ==
== Links ==
[[Unix Advanced]] - a guide to some of the more advanced parts of Unix (if you're ready).
[http://www.ee.surrey.ac.uk/Docs/Unixhelp/TOP_.html UNIXhelp for Users ] - Unix guide.
[http://www.ee.surrey.ac.uk/Docs/Unixhelp/TOP_.html UNIXhelp for Users ] - Unix guide.


[http://www.redbrick.dcu.ie/~goldfish/redbrick/ goldfish's rb guide ] - guide to some of the basic Unix commands.
[[Category:Helpdesk]]