Write structured commands in multiple lines with tab key activated
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
I'd like to write structured command in multiple lines as
$ for i in *;
→ do
→ file $i;
→ done
bmdt.md: ASCII text
breakfast.md: ASCII text
brmdh.md: ASCII text
test.sh: Bourne-Again shell script text executable, ASCII text
but find the tab not working,
How could I activate the tab key in the bash console?
bash
New contributor
avirate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
4
down vote
favorite
I'd like to write structured command in multiple lines as
$ for i in *;
→ do
→ file $i;
→ done
bmdt.md: ASCII text
breakfast.md: ASCII text
brmdh.md: ASCII text
test.sh: Bourne-Again shell script text executable, ASCII text
but find the tab not working,
How could I activate the tab key in the bash console?
bash
New contributor
avirate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
press Control-V Tab instead; Tab is bound to file/command completion by default.
– mosvy
21 mins ago
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I'd like to write structured command in multiple lines as
$ for i in *;
→ do
→ file $i;
→ done
bmdt.md: ASCII text
breakfast.md: ASCII text
brmdh.md: ASCII text
test.sh: Bourne-Again shell script text executable, ASCII text
but find the tab not working,
How could I activate the tab key in the bash console?
bash
New contributor
avirate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I'd like to write structured command in multiple lines as
$ for i in *;
→ do
→ file $i;
→ done
bmdt.md: ASCII text
breakfast.md: ASCII text
brmdh.md: ASCII text
test.sh: Bourne-Again shell script text executable, ASCII text
but find the tab not working,
How could I activate the tab key in the bash console?
bash
bash
New contributor
avirate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
avirate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
avirate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 28 mins ago
avirate
36429
36429
New contributor
avirate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
avirate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
avirate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
press Control-V Tab instead; Tab is bound to file/command completion by default.
– mosvy
21 mins ago
add a comment |Â
1
press Control-V Tab instead; Tab is bound to file/command completion by default.
– mosvy
21 mins ago
1
1
press Control-V Tab instead; Tab is bound to file/command completion by default.
– mosvy
21 mins ago
press Control-V Tab instead; Tab is bound to file/command completion by default.
– mosvy
21 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
When you press Enter after entering an incomplete command, the bash
shell will show a continuation prompt (the secondary prompt, $PS2
) and allow you to complete the entered command. The command line editing facilities of the shell at that point is the same as at the original prompt (the primary prompt, $PS1
), which means that the Tab key would do command and filename completion as usual.
To insert a tab character, use Ctrl+V Tab, or use spaces for indentation. Tab characters (or any other literal character) can always be inserted if prefixed by Ctrl+V.
Alternatively, if in Emacs command line editing mode (which I believe is the default in bash
), use Ctrl+X Ctrl+E to bring up an editor to enter your command into. The editor used will be the one specified by the EDITOR
shell/environment variable, or emacs
if this variable is unset.
In Vi command line editing mode, press Escape v to do the same thing.
The command will be executed after saving and exiting the editor.
Could I ask What's vi command line, I am aware the Vim is a editor which should be opened in advance, go inside, and edit, rather than directly type into command and run.
– avirate
2 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
When you press Enter after entering an incomplete command, the bash
shell will show a continuation prompt (the secondary prompt, $PS2
) and allow you to complete the entered command. The command line editing facilities of the shell at that point is the same as at the original prompt (the primary prompt, $PS1
), which means that the Tab key would do command and filename completion as usual.
To insert a tab character, use Ctrl+V Tab, or use spaces for indentation. Tab characters (or any other literal character) can always be inserted if prefixed by Ctrl+V.
Alternatively, if in Emacs command line editing mode (which I believe is the default in bash
), use Ctrl+X Ctrl+E to bring up an editor to enter your command into. The editor used will be the one specified by the EDITOR
shell/environment variable, or emacs
if this variable is unset.
In Vi command line editing mode, press Escape v to do the same thing.
The command will be executed after saving and exiting the editor.
Could I ask What's vi command line, I am aware the Vim is a editor which should be opened in advance, go inside, and edit, rather than directly type into command and run.
– avirate
2 mins ago
add a comment |Â
up vote
4
down vote
When you press Enter after entering an incomplete command, the bash
shell will show a continuation prompt (the secondary prompt, $PS2
) and allow you to complete the entered command. The command line editing facilities of the shell at that point is the same as at the original prompt (the primary prompt, $PS1
), which means that the Tab key would do command and filename completion as usual.
To insert a tab character, use Ctrl+V Tab, or use spaces for indentation. Tab characters (or any other literal character) can always be inserted if prefixed by Ctrl+V.
Alternatively, if in Emacs command line editing mode (which I believe is the default in bash
), use Ctrl+X Ctrl+E to bring up an editor to enter your command into. The editor used will be the one specified by the EDITOR
shell/environment variable, or emacs
if this variable is unset.
In Vi command line editing mode, press Escape v to do the same thing.
The command will be executed after saving and exiting the editor.
Could I ask What's vi command line, I am aware the Vim is a editor which should be opened in advance, go inside, and edit, rather than directly type into command and run.
– avirate
2 mins ago
add a comment |Â
up vote
4
down vote
up vote
4
down vote
When you press Enter after entering an incomplete command, the bash
shell will show a continuation prompt (the secondary prompt, $PS2
) and allow you to complete the entered command. The command line editing facilities of the shell at that point is the same as at the original prompt (the primary prompt, $PS1
), which means that the Tab key would do command and filename completion as usual.
To insert a tab character, use Ctrl+V Tab, or use spaces for indentation. Tab characters (or any other literal character) can always be inserted if prefixed by Ctrl+V.
Alternatively, if in Emacs command line editing mode (which I believe is the default in bash
), use Ctrl+X Ctrl+E to bring up an editor to enter your command into. The editor used will be the one specified by the EDITOR
shell/environment variable, or emacs
if this variable is unset.
In Vi command line editing mode, press Escape v to do the same thing.
The command will be executed after saving and exiting the editor.
When you press Enter after entering an incomplete command, the bash
shell will show a continuation prompt (the secondary prompt, $PS2
) and allow you to complete the entered command. The command line editing facilities of the shell at that point is the same as at the original prompt (the primary prompt, $PS1
), which means that the Tab key would do command and filename completion as usual.
To insert a tab character, use Ctrl+V Tab, or use spaces for indentation. Tab characters (or any other literal character) can always be inserted if prefixed by Ctrl+V.
Alternatively, if in Emacs command line editing mode (which I believe is the default in bash
), use Ctrl+X Ctrl+E to bring up an editor to enter your command into. The editor used will be the one specified by the EDITOR
shell/environment variable, or emacs
if this variable is unset.
In Vi command line editing mode, press Escape v to do the same thing.
The command will be executed after saving and exiting the editor.
edited 2 mins ago
answered 12 mins ago


Kusalananda
111k15216343
111k15216343
Could I ask What's vi command line, I am aware the Vim is a editor which should be opened in advance, go inside, and edit, rather than directly type into command and run.
– avirate
2 mins ago
add a comment |Â
Could I ask What's vi command line, I am aware the Vim is a editor which should be opened in advance, go inside, and edit, rather than directly type into command and run.
– avirate
2 mins ago
Could I ask What's vi command line, I am aware the Vim is a editor which should be opened in advance, go inside, and edit, rather than directly type into command and run.
– avirate
2 mins ago
Could I ask What's vi command line, I am aware the Vim is a editor which should be opened in advance, go inside, and edit, rather than directly type into command and run.
– avirate
2 mins ago
add a comment |Â
avirate is a new contributor. Be nice, and check out our Code of Conduct.
avirate is a new contributor. Be nice, and check out our Code of Conduct.
avirate is a new contributor. Be nice, and check out our Code of Conduct.
avirate is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478231%2fwrite-structured-commands-in-multiple-lines-with-tab-key-activated%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
press Control-V Tab instead; Tab is bound to file/command completion by default.
– mosvy
21 mins ago