Ask Your Question
1

how to return to commandline

asked 2018-11-14 04:54:39 -0600

Unik-Web gravatar image

Hi, How to return to command line when i fire systemctl status firewalld I get this message stop line 1-13 (END) and only way to come to command line is CTRL+C and it's feel wrong command. is there better shortcut ?

edit retag flag offensive close merge delete

Comments

Why do you say “it feels wrong”? It accomplishes the job, doesn’t it?

Aeyoun gravatar imageAeyoun ( 2018-11-14 06:24:03 -0600 )edit
1

It could be helpful to add the info on the last line showing how to quit. Just like the man command does:

 Manual page man(1) line 1 (press h for help or q to quit)
villykruse gravatar imagevillykruse ( 2018-11-14 10:10:00 -0600 )edit

2 Answers

Sort by » oldest newest most voted
3

answered 2018-11-14 07:18:09 -0600

ozeszty gravatar image

Hi, just press q and it will exit to terminal prompt. In this case using q or Ctrl-C (sending SIGINT) makes no difference, because no important action will be interrupted - systemctl status just views information and doesn't write or send anything back (I think).

edit flag offensive delete link more
1

answered 2018-11-14 07:52:08 -0600

rzbyn gravatar image

There are other shortcuts like ctrl + z, ctrl + d and ctrl + \ to come back to your command line. You can run stty -a on your terminal to see other shorcuts like:

intr = ^C; quit = ^\; erase = ^?; kill = ^U;
eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O;

I often to usectrl + z to get back to my command line because it suspends current job which later I can bring it back without redoing commands.
e.g.
When top stopped with ctrl + z
The terminal will show:
[1]+ Stopped top
Then you can run other command on your terminal.
When 1 or more jobs are suspended, jobs command will list them down:
[1]- Stopped top
[2]+ Stopped systemctl status httpd.service
[3]+ Stopped systemctl status mariadb.service
Then use fg n to bring a jobs back to foreground without redoing the full command
or bg n to make the process runs on the background.
If you want to kill a suspended program you can do kill %n
where n is the number from the list [n].

source

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2018-11-14 04:54:39 -0600

Seen: 65 times

Last updated: Nov 14 '18