28
Improving your shell usage by Chris Sinjakli (Sinjo)

Improving your shell usage - 2010

Embed Size (px)

DESCRIPTION

Introduction to using a shell talk given to new UWCS members in 2010. Overhaul of the 2009 version.

Citation preview

Page 1: Improving your shell usage - 2010

Improving your shell usage

by Chris Sinjakli (Sinjo)

Page 2: Improving your shell usage - 2010

Why?

• Department computers• CS student (Pro Skills module)• Web hosting• IRC

Page 3: Improving your shell usage - 2010

Navigation

Where am I?

The pwd command will show you the current working directory:

Page 4: Improving your shell usage - 2010

Navigation

Changing directory

The cd command will change to the directory specified:

Page 5: Improving your shell usage - 2010

Navigation

Listing directory contents

The ls command lists the contents of current directory:

Page 6: Improving your shell usage - 2010

Navigation

Other useful commands:

• cp <source> <destination> - Copies <source> to <destination>• mv <source> <destination> - Moves <source> to <destination>• mkdir <name> - Creates a directory called <name>• rm <target> - Removes <target> (no “Are you sure?”, be careful)

Page 7: Improving your shell usage - 2010

Editing files

Nano

Quick to get started with, shortcuts at the bottom

Page 8: Improving your shell usage - 2010

Editing files

Vim

More advanced, learn how to quit before opening

Page 9: Improving your shell usage - 2010

Editing files

Emacs

Also advanced, I’ve never actually used it

Page 10: Improving your shell usage - 2010

Command History

A faster way to retype commands

• Previously typed commands are saved• Up/down arrow keys can be used to access them• Not that useful if you want to go far back

Page 11: Improving your shell usage - 2010

Command History

Searching through History

Press Ctrl+r to search your shell history.

As you type, it will narrow down hits in your history.

Page 12: Improving your shell usage - 2010

Leaving things running

• Running programs stop when you exit the shell

• Programs can be left running inside the screen application

Page 13: Improving your shell usage - 2010

Leaving things running

Creating a session

You can create a new session by just using the "screen" command.

Page 14: Improving your shell usage - 2010

Leaving things running

Resuming a session

The -r switch is used to reattach a screen session.

$ screen -r[your previous session will appear here]

Page 15: Improving your shell usage - 2010

Leaving things running

Resuming a session

If you're already attached to a session from somewhere else, you'll see something like this:

$ screen -rThere are screens on: 15716.pts-4.viglab-26 (Attached)There is no screen to be resumed.

Page 16: Improving your shell usage - 2010

Leaving things running

Resuming a session

You can remote detach the running session, allowing you to attach it elsewhere.

$ screen -d[remote detached]

You can combine the two switches 'screen -dr' to remote detach, then reattach here.

Page 17: Improving your shell usage - 2010

Persistent IRC connection

• Leave irssi (an IRC client) running in screen• No disconnects/reconnects to the server• Chat history• Used by a lot of our members

Page 18: Improving your shell usage - 2010

Persistent IRC connection

With screen open:

1. Run irssi$ irssi

2. Connect to a server (irc.uwcs.co.uk for ours)/connect <Server Address>

Page 19: Improving your shell usage - 2010

Persistent IRC connection

Joining a channel

/join #compsoc

Page 20: Improving your shell usage - 2010

Persistent IRC connection

Switching channels

• Hotkeys for lower number channels (Alt + 1-0, Alt + q-o)• /win <number> command for anything above that• Alt + a to go to next window with activity

Page 21: Improving your shell usage - 2010

Persistent IRC connection

Leaving a channel

In the channel you wish to leave:

/part <Quit Message>

Page 22: Improving your shell usage - 2010

Our services

• Web hosting• Database• Shell access to member server (Codd)

Page 23: Improving your shell usage - 2010

Web hosting

• Included in membership• YourName.uwcs.co.uk by default• 1GB of quota (upgradable)• Support for PHP sites (WordPress, Drupal, etc)• Available to societies

Page 24: Improving your shell usage - 2010

Web hosting

• Basics– YourName.uwcs.co.uk– Files in ~/public_html/– Just Works (most of the time, some things like

Drupal need more config on our side)– Need to request a shell account

Page 25: Improving your shell usage - 2010

Web hosting

• Your own domain– Register with your preferred registrar– Point DNS records to our server– Nudge techteam to configure our web server

• What is your domain name?• Which directory is your site in?

Page 26: Improving your shell usage - 2010

Database

• MySQL database for each user• Needs requesting separately to shell account• Necessary for WordPress, etc• Also available to societies

Page 27: Improving your shell usage - 2010

Questions?

Page 28: Improving your shell usage - 2010

Contact

• IRC: irc.uwcs.co.uk• Forums: forums.uwcs.co.uk• Email: [email protected]

There is a topic on the forums for this talk.