text processing – How to make the output of command “tor” to print the last word which is “Done”?

So, when I run the command tor in cli it shows something like this:

May 10 22:41:08.743 (notice) Tor 0.4.5.7 running on Linux with Libevent 2.1.12-stable, OpenSSL 1.1.1k, Zlib 1.2.11, Liblzma 5.2.5, Libzstd 1.4.8 and Glibc 2.31 as libc.
May 10 22:41:08.743 (notice) Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
May 10 22:41:08.743 (notice) Read configuration file "/etc/tor/torrc".
May 10 22:41:08.744 (notice) Opening Socks listener on 127.0.0.1:9000
May 10 22:41:08.744 (notice) Opened Socks listener connection (ready) on 127.0.0.1:9050
May 10 22:41:08.000 (notice) Parsing GEOIP IPv4 file /usr/share/tor/geoip.
May 10 22:41:08.000 (notice) Parsing GEOIP IPv6 file /usr/share/tor/geoip6.
May 10 22:41:08.000 (notice) Bootstrapped 0% (starting): Starting
May 10 22:41:09.000 (notice) Starting with guard context "default"
May 10 22:41:10.000 (notice) Bootstrapped 5% (conn): Connecting to a relay
May 10 22:41:10.000 (notice) Bootstrapped 10% (conn_done): Connected to a relay
May 10 22:41:10.000 (notice) Bootstrapped 14% (handshake): Handshaking with a relay
May 10 22:41:11.000 (notice) Bootstrapped 15% (handshake_done): Handshake with a relay done
May 10 22:41:11.000 (notice) Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits
May 10 22:41:11.000 (notice) Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay to build circuits
May 10 22:41:11.000 (notice) Bootstrapped 95% (circuit_create): Establishing a Tor circuit
May 10 22:41:12.000 (notice) Bootstrapped 100% (done): Done

Now, what I want is to only print the last word of last line which is Done

When I tried tor | grep Done, I got this:

May 10 22:41:12.000 (notice) Bootstrapped 100% (done): Done

When I tried

  • tor | cut -d " " -f 8
    or
  • tor | cut -d " " -s -f 8
    or
  • tor | awk -F " " '{print $8}'

PS: I don’t understand the difference between first two, I’ve tried man cut. I’M A NEWBIE.
So, with the above three commands, the result was:

on
you
"/etc/tor/torrc".
on
connection
file
file
Starting
context
Connecting
Connected
Handshaking
Handshake
Loaded
Handshake
Establishing
Done

Now, when I combined “grep” and (“cut” or “awk”) as shown below,

  • tor | grep Done | awk -F " " '{print $8}'
    or
  • tor | grep Done | cut -d " " -f 8
    or
  • tor | grep Done | cut -d " " -s -f 8

or by writing the grep command after cut or awk
there is no output:


But it should have worked as I’ve seen on many discussion forums before asking it here.

Are my packages broken?
Or is there something fishy with tor command?