170 likes | 259 Views
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
E N D
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 The cd command will change to the directory specified:
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.
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.
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.
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
Persistent Sessions with GNU Screen Creating a session You can create a new session by just using the "screen" command.
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]
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.
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.
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>
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
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>
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>
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!