Display Command-line History

Command-line history is available by invoking the nuosql history command and either the double-bang command (!!), the bang command (!), or command line editing.

Command line history is supported on Linux systems only.

To view command line history, enter the history command at the nuosql prompt.

For example:

history
...
244 select * from system.querystats ;
245 show table system.querystats;
246 use system
247 show tables
248 history
249 help history
250 history
251 use user
252 drop table t if exists;
253 create table t (x int);
254 insert into t values (1),(2),(3);
255 select * from t;
256 history

Execute Previous Command

To execute the previous command, use any of the following two options.

  • Use !!:

  • Type CTRL-p to get to the previous command and then hit enter.

To execute the previous command that started with the string, use ! followed by the string.

For example, to execute the previous command that started with the string select, use !select.

select * from t;
X
--
1
2
3
insert into t values (4);
!select
select * from t;
X
--
1
2
3
4