agraja.wordpress.com

Posts Tagged ‘terminal’

Linux Desk Calculator

In Linux on October 5, 2007 at 4:08 am

Terminal command to perform arithmetic operations

dc [OPTION] [file ...]

-e    –expression=EXPR    evaluate expression

-f    –file=FILE                    evaluate contents of file

Basic arithmetic uses the standard + – / * symbols but entered after the digits

To print result type p

To quit dc type q

desk_calculator.JPG

Monitor Terminals Using script Command

In Linux, Shell on October 4, 2007 at 6:34 am

Open a terminal and type as below

[raja@AGRAJA ~]$ mkfifo output
[raja@AGRAJA ~]$ script -f output

Open another terminal and type as below

[raja@AGRAJA ~]$ cat output

Now return to first terminal and execute any command.

Everything on the first terminal is updated on the second terminal also.

script.JPG


Multiple Windows in a Terminal

In Linux, Shell on October 4, 2007 at 5:59 am

Manage multiple terminals using screen utility

[raja@AGRAJA ~]$ screen -t name_of_screen
[raja@AGRAJA ~]$ screen -t name_of_screen2 screen_no

To navigate between screens:

1) CTRL+a

2.1) Type to list available screens; use arrow keys to select

[or]

2.2) Type w to list screens on the title bar for a moment.

i) CTRL+a

ii) type screen_no (it can be 0, 1, 2 … )

To scroll within a screen

1) CTRL+a

2) ESC

3) Page-Up/Page-Down

terminal_screen.JPG