1 / 17

Improving your shell usage

Improving your shell usage. Learn how to get around. Where am I? The pwd command will show you the current working directory:. Learn how to get around. Listing directory contents The ls command lists the contents of current directory:. Learn how to get around. Changing directory

missy
Download Presentation

Improving your shell usage

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Improving your shell usage

  2. Learn how to get around Where am I? The pwd command will show you the current working directory:

  3. Learn how to get around Listing directory contents The ls command lists the contents of current directory:

  4. Learn how to get around Changing directory The cd command will change to the directory specified:

  5. Editing files Manually Usual choices of editors to use on the command line are: • nano – Tiny learning curve, shortcuts displayed by default • vim – Powerful, steeper learning curve, more features (my preferred editor) • emacs – I’ve never used it. Steep learning curve, powerful, lots of features.

  6. Command History A faster way to retype commands When you type commands into your shell, they are stored in a history file. You can access previous commands using the up arrow key. The down key obviously goes the other way in your history.

  7. Command History Searching through History You can also search through your history like you would use the "find" tool in a browser or text editor. Use Ctrl+R, and you should see something like this: As you type, it will narrow down hits in your history.

  8. Persistent Sessions with GNU Screen Allows you to leave things running on a machine which you want to come back to later. Some common use cases: • Working on a remote machine (via something like PuTTY) on an unstable connection. If you get disconnected, this will allow you to resume exactly where you left off • On your own linux machine when updating and restarting the graphical environment. The update program, if running in a graphical terminal (like gnome-terminal or xterm) will be killed partway through the process if you are not running them separately in screen. • Running programs on remote machines that won't run in the background. • Lurking in chat channels by running your IM clients on a machine that has more uptime than yours

  9. Persistent Sessions with GNU Screen Creating a session You can create a new session by just using the "screen" command.

  10. Persistent Sessions with GNU Screen Resuming a session The -r switch is used to reattach a screen session.$ screen -r[where you were in your previous session]

  11. Persistent Sessions with GNU Screen 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.

  12. Persistent Sessions with GNU Screen Resuming a session You can remote detach from this session, freeing it up for you to resume here. Use screen -d to do this, however we will insist on using -D because this both detaches the session and logs out the parent shell, which is far safer.$ screen -D[15716.pts-4.viglab-26 power detached.]You can of course combine the two switches 'screen -Dr' to remote detach, then reattach here.

  13. Persistent IRC connections – irssi in screen Starting irssi and connecting After creating a screen/attaching an previously created screen, run irssi. $ irssi In irssi, to connect to a server you use the /connect command as follows: /connect <Server Address>

  14. Persistent IRC connections – irssi in screen Joining a channel Having connected you’ll probably want to talk to people. You join a channel with /join. In this case we’ll join our main channel. /join #compsoc

  15. Persistent IRC connections – irssi in screen Switching channels To switch between channels is simple. Windows 1-19 can be accessed through pressing alt and either a number 1 to 0 above the letter keys or a letter between q and o (ie most of the top row of the qwerty keyboard). After that you simply use the command: /win <Window Number>

  16. Persistent IRC connections – irssi in screen Leaving a channel Leaving a channel is simple. Simply navigate to the correct window and run: /part <Quit Message>

  17. The End(ish) • You should be able to log into your UWCS shell account and get started. • Don’t be afraid to ask someone if you’re having problems, but the majority of the time there will be a good answer available if you google for your problem. • What I’ve talked about is only an introduction. This talk could probably last a year and still not cover everything. You will definitely pick things up as you go along. • Don’t be daunted by what might be a completely new way of using a computer for you. Simply having a go is the best way to learn! Onward to DCS!

More Related