Skip to content

Commit ca4cfc2

Browse files
author
James Halliday
committed
screen
1 parent 01682e0 commit ca4cfc2

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

screen.markdown

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# screen
2+
3+
You can use screen to run command-line programs and keep
4+
them running, even when you go away.
5+
6+
---
7+
# install screen
8+
9+
$ sudo apt-get install screen
10+
11+
---
12+
# create a new named screen
13+
14+
$ screen -S website
15+
16+
---
17+
# list screens
18+
19+
$ screen -list
20+
21+
---
22+
# connect to a screen
23+
24+
$ screen -x website
25+
26+
---
27+
# detach from a screen
28+
29+
From inside of a screen, press CTRL+A then `d`.
30+
31+
---
32+
# create a new window inside screen
33+
34+
CTRL+A c
35+
36+
---
37+
# go to the next window
38+
39+
CTRL+A n
40+
41+
---
42+
# go to the previous window
43+
44+
CTRL+A p
45+
46+
---
47+
# close a window
48+
49+
Just type `exit` to close a window.
50+
51+
---
52+
# irc from the command-line
53+
54+
Install irssi:
55+
56+
$ sudo apt-get install irssi
57+
58+
Then create a screen for irc:
59+
60+
$ screen -S irc
61+
62+
---
63+
Then in a screen, you can run `irssi` to use irc from the
64+
command line.
65+
66+
* `/nick robowizard` - set your nickname on the server
67+
* `/connect irc.freenode.net` - connect to irc.freenode.net
68+
* `/join #cyberwizard` - join the channel called cyberwizard
69+
* ESC+N or `/win N` - to jump to the window at number N
70+
71+
Once you're in a channel, type text like usual.
72+
`CTRL+A d` to detach and `screen -x irc` to resume.
73+
74+
---
75+
# run a web server
76+
77+
Make a web server.js:
78+
79+
``` js
80+
var http = require('http');
81+
var server = http.createServer(function (req, res) {
82+
res.end("YOU'RE A WIZARD.\n");
83+
});
84+
server.listen(8000);
85+
```
86+
87+
now run your server with node from inside a screen:
88+
89+
```
90+
$ node server.js
91+
```
92+
93+
then detach the screen with CTRL+A d.
94+

0 commit comments

Comments
 (0)