Skip to content

Instantly share code, notes, and snippets.

@explodecomputer
Last active August 29, 2015 14:16
Show Gist options
  • Save explodecomputer/07f9913404db21a40dd9 to your computer and use it in GitHub Desktop.
Save explodecomputer/07f9913404db21a40dd9 to your computer and use it in GitHub Desktop.
unix tutorial

Introduction to Linux

Overview

A lot of servers use Linux and we need to use a server to run a few specific programmes so let's get familiar with Linux.

First of all, to connect to the server we will use a SSH connection. The idea is that we log in to the remote server from our local computer, so when we are running anything on the server we are using its hardware and infrastructure and our local computer is being used to simply view what is happening remotely and to input commands.

Here is a diagram:

ssh

Getting connected

We will use a programme called Putty to allow us to interact with the remote server, and a programme called WinSCP to transfer files between our local computer and the remote server.

Transferring files

Show how to connect using WinSCP

Logging into the server

To connect we need to tell Putty the remote server's address and our security credentials.

screenshot of putty setup screen

hostname:

add pelotas.ppk.

Directory structure and navigation

The files and folders on Linux are organised in the same way as they are in Windows - in a heirarchical structure. At the very top of the structure is the root directory which is denoted by a single slash /. Everything else is a sub-directory (or sub-sub-directory or sub-sub-sub-directory etc) of the root directory.

As a user you have a home directory, e.g. the directory for user pelotas1 is located at /home/pelotas1.

The command line always We can move from one folder to another using the cd command. For example, to

When the user pelotas1 logs into the server they are automatically taken to their home directory

  1. directory navigation

The Linux filesystem is a tree-like hierarchy hierarchy of directories and files. At the base of the filesystem is the “/” directory, otherwise known as the “root” (not to be confused with the root user). Unlike DOS or Windows filesystems that have multiple “roots”, one for each disk drive, the Linux filesystem mounts all disks somewhere underneath the / filesystem. The following table describes many of the most common Linux directories.

  1. viewing and editing files
  2. run scripts
  3. cancel something that is running
  4. data manipulation
  5. piping
  6. using scripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment