in linux, Tutorials

I administrate linux servers from time to time, and a common need in those situation is monitoring what a different terminal is doing. Either because of a lost connection to an SSH terminal which runs a command, or wanting to know what an unrecognized terminal is doing. To that end I use a very useful tool called strace.

Strace is a system utility on linux systems that can trace all systems calls and signals that a process uses. To monitor a terminal we can make strace print all occurrences of the read and write system calls that the terminal process is using.

Note: This tutorial assumes you have root privileges otherwise you won't be able to use strace to connect and monitor a running process.

To see who’s connected to the machine we can list /dev/pts. The directory contains special character files for each connected pts.

To use strace for the task at hand, we first need to identify the terminal we want to connect to. We can use ps which lists all the running processes like so:

alpha@milkyway:~$ ps aux | grep pts
alpha      943  0.0  0.0  44472  3344 pts/4    R+   09:23   0:00 ps aux
alpha      944  0.0  0.0  21536  1048 pts/4    S+   09:23   0:00 grep --color=auto pts
alpha     7978  0.0  0.0  29812  5172 pts/3    Ss+  09:16 0:00 bash
alpha    22659  0.0  0.0  29812  5192 pts/0    Ss   00:13   0:00 bash
root     22877  0.0  0.0  72716  4304 pts/0    S    00:24   0:00 sudo su alchemist
root     22878  0.0  0.0  72248  3884 pts/0    S    00:24   0:00 su alchemist
alchemi+ 22891  0.0  0.0  29808  5100 pts/0    S+   00:24   0:00 bash
alpha    23022  0.0  0.0  29812  5104 pts/1    Ss   00:28   0:00 bash
root     23034  0.0  0.0  72956  4424 pts/1    S    00:28   0:00 sudo su
root     23035  0.0  0.0  72248  3780 pts/1    S    00:28   0:00 su
root     23049  0.0  0.0  28712  3924 pts/1    S+   00:28   0:00 bash
alpha    24095  0.0  0.0  29812  5144 pts/2    Ss+  01:15   0:00 bash

To see all the input and output of the pts we’re interested in we can call strace with the following arguments:

strace -f -s999 -e trace=write -p 7978

-f: This option tells strace to follow the system calls for the child processes as well (commands run in the terminal).

-s: by default strace truncates strings, we can set the truncate limit higher so we can see more of the output.

-e trace=write: the system calls we want to monitor. For our task we only want to see the output in the terminal. If you want to log what the user types you can add the read call as well. The format is trace=syscalls1,syscall2,..

-p: The pid of the process we’re monitoring.


The output is useful, but it would be more useful if the output was more human suitable. You’re in luck, I wrote a simple wrapper to make the output appear like a normal terminal. You can download it from here.

Write a Comment



  • seo plan template 2018

    seo plan template 2018

    jqppqibbi wgics ylhrasf gryb tycbclmukvgrleh

  • dating sites contact united states

    sex dating free

  • best internet dating websites

    dating services contact australia

  • dating apps

    dating singles

  • free singles

    the dating game

  • dating apps

    simple-dating life

  • free dating site

    dating web site

  • sex dating site

    dating sites that are totally free

  • pof dating login

    senior dating services

  • free dating service

    online site

  • best free dating sites

    free online chatting and dating

  • connecting singles games

    best dating sites for free

  • coursework writing services

    degree coursework

  • coursework help university

    buy coursework

  • do my coursework for me

    differential equations coursework

  • coursework writing service

    do my coursework

  • coursework in english

    coursework samples

  • custom coursework writing

    coursework paper

  • do my coursework for me

    cpa coursework

  • coursework writer

    coursework support

  • coursework samples

  • coursework questions

    coursework service

  • 3influenza


  • paper writing help

    custom written paper

  • pay to do paper

    help me with my paper

  • buy a literature review paper

    buying papers for college

  • scientific paper writing services

    order papers online

  • buying college papers

    i need help writing a paper

  • paper writing service college

    college papers help

  • buy cheap papers

    paper writing services legitimate

  • write my apa paper

    custom thesis papers

  • college paper writing help

    custom written paper

  • write my business paper

    what should i write my paper about

  • help writing a paper for college

    paper help writing

  • write my philosophy paper

    write my custom paper

  • buy a college paper online

    pay to write papers

  • paper writing services legitimate

    buy papers for college

  • will someone write my paper for me

    buy cheap paper

  • best paper writing services

    custom papers writing

  • help write my paper

    need help with paper

  • buy custom paper

    help with paper writing

  • custom thesis papers

    i don’t want to write my paper

  • gay chat rooms ring central

    chat gay vegas

  • gay chat web cab room facebook

    easy gay chat

  • gay chat rooms ring central

    chat gay almeria

  • gay chat rooms free in illinois

    teen gay dick snap chat

  • gay perv chat group

    old gay men video chat rooms

  • new york gay chat lines

    free gay cam chat

  • gay chat rooms no registration needed

    gay live chat rochester video

  • gay adult phone chat

    skype gay chat

  • free seattle wa gay and bi mens chat sites

    dubuque gay chat

  • gay web chat rooms

    gay video chat free

  • gay sex chat online

    totaly free gay chat

  • casino streaming online

    new jersey online casino

  • pa caesars online casino

    online casino review

  • lucky casino online

    online casino slots real money

  • amature dating co

    dating service

  • connecting singles dating site

    best free online dating

  • online dating 50

    skycouger gf

  • dating sims free online japanese adult

    singles singles

  • dating sites absolutely free


  • date online site


  • local-singles club

    international singles

  • dating gmail germany

    new dating

  • top free dating sites

    pof dating

  • freetalk45

    eris free downloads chatting apps

  • matchmaking dating

    senior dating sites free

  • japanese dating sites

    single woman free

  • gay dating site crossword

    gay dating app windows

  • best gay dating apps

    best dating website for gay man to pay for

  • gay dating guam

    gay movie online dating

  • best vpn for crypto trading

    proton vpn download

  • best vpn for omegle

    best free vpn for ios

  • free vpn apk

    best vpn for porn

  • business vpn setup

    best free vpn for macbook

  • best vpn for macbook

    what is a vpn connection

  • vpn review

    vpn torrent

  • free vpn canada

    hotspot vpn free download

  • vpn free pc

    free vpn for roobet

  • online casino us

    four winds online casino

  • online casino vegas

    juegos de casino online

  • casino games free online play

    online casino real money california

  • online casino sign up bonus

    atlantic city online casino

  • online casino ideal

    zone online casino

  • casino online betting

    ocean online casino app

  • parx casino online gambling

    riversweeps casino online

  • jumba bet online casino

    online casino with free signup bonus real money no deposit

  • ocean casino online login

    online casino sweepstakes

  • free casino online games

    sugarhouse online casino pa

  • michigan online casino no deposit bonus

    ocean online casino app

  • hollywood online casino

    pala casino online

  • live blackjack online casino

    online casino with free signup bonus real money usa no deposit

  • riversweeps 777 online casino app

    casino in gta 5 online

  • las vegas casino online

    online casino sites

  • live casino online free

    online casino no verification withdrawal usa

  • online casino games free

    caesar casino online nj

  • online casino with no deposit bonus

    betfair casino online

  • how long is a dissertation paper

    uk dissertation writing help quotes

  • writing a doctoral dissertation

    write your dissertation

  • order a dissertation

    dissertation cover page

  • define dissertation

    nursing dissertation help

  • uf dissertation award

    dissertation template

  • phd dissertation peer reviewing help

    thesis vs dissertation

  • research writing help

    dissertation writing advice

  • phd without dissertation

    phd dissertation writing

  • dissertation writing grants

    proposal and dissertation help 2000 words

  • dissertation writing service

    dissertation writing skills

  • dissertation literature review

    chicago illinois dissertation help

  • dissertation writing process

    writing methodology for dissertation

  • help with dissertation topic

    proposal and dissertation help 2000 words

  • writing tutor

    medical dissertation writing services

  • help writing a dissertation

    dissertation help service quality

  • 2helpfulness


  • 2carolina


  • get dissertation help

    writing dissertation aims and objectives

  • professional dissertation writing

    thesis and dissertation

  • write my dissertation uk help i can

    dissertation proposal sample

  • dissertation chapters

    thesis dissertation writing services

  • dissertation writing services uae

    online cheap dissertation help

  • dissertation writing service

    help with completing dissertation

  • hollywood4fun slots

    slots inferno

  • wizard of oz slots

    myvegas slots facebook

  • nasty slots

    online slots real money

  • reel deal slots

    igt slots

  • common expansion slots

    how to win at slots

  • my vegas slots

    ff7 cait sith slots limit

  • son and moon slots

    triple diamond slots

  • las vegas world slots free

    play free bonus slots

  • innovative slots

    free classic slots

  • vegas downtown slots

    free slots for pc

  • scatter slots by murka

    888 free slots machine

  • slots free online

    slots of vegas casino

  • gay dating fargo nd

    gay dating online

  • local gay sex chat

    transcript of a man’s first gay chat

  • local gay chat rooms

    chicago gay chat rooms free

  • gay bear dating sites

    torrington ct gay dating

  • dirty gay sex chat

    gay chat aveneu

  • gay dating sites yahoo answers

    single gay dating site

  • gay dating search for free

    dinner for eight gay dating

  • fat chub gay dating

    chubby gay mens dating sites

  • boomerang gay dating

    feminine gay dating sites

  • college gay dating site

    gay dating app for over 50

  • gay dating sites for kids 10-14

    gay addiction dating apps

  • 2warship