Use Linux Screen for Console Access

When you use Linux, there’s no need to use Minicom or Putty for console access. You can also use screen for direct console access. Here’s how to do it:

$ sudo screen /dev/ttyUSB0

Just use the screen command and specify your device. In my example, I’m using a USB to Serial adapter. You’ll find yourself at the console. I’m using a Cisco router here:

Router# 

If you want to scroll up, you’ll need to hit CTRL-A and then hit the [ button. You’ll see something like this:

Copy mode - Colum 8 Line 49(+1024) (190,49)

You can now use the page up / down or the arrow buttons to scroll up and down. Hit the ESC button to return to console access.

Cisco engineers might need the break function to access rommon. CTRL + BREAK won’t work, but there is another method in screen. Do a CTRL-A and then CTRL-B to send a break. You can hit CTRL-B a couple of times to send multiple breaks.

Once you are done at the console you do CTRL-A and then K to exit your console session.

That’s all there is to it. I hope this is useful for you!

Tags:


Forum Replies

  1. Hi Rene
    WHy do not you also write about Linux Certification, you have potential and lot of people will be very pleased with you. Think about it.
    Regards
    Mario Rosario

  2. Hi Mario,

    Thanks, I might do it in the future but first I have plenty of Cisco material I want to write about :slight_smile:

    Rene

  3. Hi Rene,

    Do you know how in linux is possible to save the output from the console to a file.txt?

    Thanks

  4. Hello Giovanni

    In Linux, the command script will do what you are asking for. Take a look at the man page for this command.

    In short, you can type script output.txt and all subsequent commands and output will be saved to the output.txt file. Here is an example of the commands you can use:

    $ script output.txt
    Script started, file is output.txt
    
    $ ls
    output.txt  testfile.txt  foo.txt
    
    $ exit
    exit
    Script done, file is output.txt
    

    You can then read the output.txt file which will have all of the CLI commands and outputs you saw on the terminal.

    I hope this has been helpful!

    Laz

  5. This is great, thanks Laz

3 more replies! Ask a question or join the discussion by visiting our Community Forum