Linux Tutorial- Part: 1

From Sector Alpha Wiki
Revision as of 23:41, 31 October 2013 by Chakyl (talk | contribs) (Created page with "=== Navigating The Workspace === This tutorial will walk you through linux commands as if you managing a Minecraft server. For a list of relevant commands, see the [[Linux Com...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Navigating The Workspace

This tutorial will walk you through linux commands as if you managing a Minecraft server. For a list of relevant commands, see the Linux Command Reference. A list of commands used in this part of the tutorial will be posted at the end of the tutorial.

Assuming you have already set up an account on SASHA, (If not, see the Linux Tutorial- Part: 0.), the first command you will always use is ssh minecraft@localhost. There will be other cases where you will use other variations of this command, which I will go over later in this tutorial.

Once you input that command, you will be prompted to enter the password you made (Hopefully in part 0 of this tutorial. You now *should* be in the main minecraft directory. When you see the word directory, you mind should automatically convert the word to ‘’’folder’’’. They’re essentially the same thing, and have the same functions. So, you’re in the main directory, but how do you see everything that’s in? Well little Joey, the answer is simple. Use the command ls to see absolutely everything in a directory. ls stands for ‘’’list’’’, as in ‘’’list’’’ everything inside this folder. The colours of the files stand for different things (which I will glaze over in a bit), so don’t be intimidated by them.

Now comes the guts of navigation, changing directories. As I mentioned before, every file on Linux is colored to represent different things. For example, a ‘’’directory’’’ is Template:Color, and a .jar file is Template:Color. Use ls to view the files in the ‘’’directory’’’, and look at which ones are coloured Template:Color. Because you’re inside the Minecraft ‘’’directory’’’, you should see the ‘’’directory‘’’ Template:Color. Alright, here comes the exciting part. Use the command cd split_worlds to go to the ‘’’directory’’’! Alright, it’s not that exciting, but writing this tutorial is a bit dull and I need to entertain myself ‘’somehow’’. Anyways, the cd <directory name> command is probably the command you will use most in navigation, and it stands for ‘’’change directory’’’. As you may have noticed, the name if the directory you’re in is shown write before the input (Where you type). If you use the command cd games, it should say minecraft@localhost/split_worlds/games/:. Now, as you noticed, it took two commands to get to this point. These two commands can be shortened to one by using the command cd /split_worlds/games/. This is especially useful when you have to get deeply nested ‘’’directories’’’ faster. But how do we get back to the main directory? Well little Joey, there are two simple ways. If we want to go from the ‘’’games’’’ directory to the ‘’’split_worlds’’’ directory, you can use the command cd ... All this command does is brings you to the previous directory, so in this case you would be in the directory ‘’’split_worlds’’’. Now for command number two. The cd, without any directory name after it. This command will bring you back to the main directory. It is a very useful command when you’re really nested deep in a directory, and you don’t want to use cd .. a bunch of times.

Basic controls

Alright, lets step back a bit and take a look at the basic controls of PuTTY. There’s not a huge amount, but they are incredibly useful. The first one is the repeat command control, or the up and down arrow keys. This will show all the previous commands you used, no matter how long ago. You have to experiment a bit to understand it fully, but it’s incredibly useful once you get the hang of it. Now, here’s the weird part about Linux that takes a bit of getting used to. When you highlight text in Linux, you don’t have to use ‘’’Ctrl + C’’’ like you do in Windows, all you have to do is ‘’’Right click’’’. The strange thing about right clicking, is that although it may copy, it also pastes text in the command/input line. This is expecially useful later on when you have long file names like ‘’’rEallYLongFilenamewithsTrangeVCAPps.zip’’’, and you don’t want to type it out again. It is ‘’incredibly’’ important that you start learning to do it as soon as possible and not later, because there are some cases where ‘’’Ctrl + C’’’ can can really cause trouble (Like in the server console, which I will go over in part X). And that’s it! All the controls you will ever need to navigate PuTTY. I haven’t found a case where you need to use anything else, but if I do I will post it here.

Command Explanation
ssh server@localhost Connects the the target server.
ls Lists all objects/files in the directory.
cd <directory> Moves you into target directory.
cd .. Returns you to previous directory.
cd Returns you to the main directory
Term Definition
‘’’Directory’’’ Folder.
‘’’ls’’’ List
‘’’cd’’’ Change directory.
Control Function
‘’’Up/Down Arrows’’’ Shows command history
‘’’Right Click Copies and pastes text automatically.