How to add shortcut commands in Xshell

How to add shortcut commands in Xshell

As a useful terminal emulator, Xshell is often used by developers to remotely manage host servers. In order to operate more efficiently, we can add some shortcut commands to operate using commands.

How to add shortcut commands? Let’s learn the specific operation methods below.

The specific steps are as follows:

Step 1: Click the "View" menu in the Xshell menu bar and check "Quick Commands" in the drop-down options, as shown in the figure below.


Check Quick Commands

Figure 1: Check Quick Commands under View

Step 2: After performing the above operations, you can see the location to add the quick command shortcut key at the bottom of the window. Double-click to add it.


Quick command add location

Figure 2: Quick command add location

Step 3: In the Quick Command Set dialog box that pops up, give your shortcut a name and set the corresponding command to be executed. For example, for "Show date", the corresponding command to be executed is date.


Adding a Quick Command

Figure 3: Adding a shortcut command

In addition to being able to add shortcut commands yourself, it actually also includes some local commands. For details, please refer to: Xshell local command encyclopedia.

Step 4: Confirm and close the dialog box. You can see the newly added shortcut command button at the bottom of the previous window. Clicking it is equivalent to entering a shortcut command in the command line interface. This is a very convenient input function when the command is commonly used and relatively long.


Enter a shortcut command

Figure 4: Enter the shortcut command

Follow the steps above to add shortcut commands in Xshell, so that you can manage remote hosts more efficiently and improve work efficiency. Click Xshell Download to get the latest version and install it on your computer

delete
ctrl + d deletes the character at the cursor position, which is equivalent to x or dl in VIM
ctrl + h deletes the character before the cursor position, which is equivalent to hx or dh in VIM
ctrl + k deletes all characters after the cursor, equivalent to d shift + $ in VIM
ctrl + u deletes all characters before the cursor, equivalent to d shift + ^ in VIM
ctrl + w deletes the word before the cursor, which is equivalent to db in VIM
ctrl + y restores the characters deleted by ctrl + u last time
ctrl + ? Undo the previous input
Alt + r Undo the previous action
Alt + d deletes the word after the cursor

move
ctrl + a moves the cursor to the beginning of the command line, which is equivalent to shift + ^ in VIM
ctrl + e moves the cursor to the end of the command line, which is equivalent to shift + $ in VIM
ctrl + f The cursor moves back one character, which is equivalent to l in VIM
ctrl + b moves the cursor forward one character, equivalent to h in VIM
ctrl + left arrow key Move the cursor to the beginning of the previous word
ctrl + right arrow key Move the cursor to the end of the next word
ctrl + x jumps between the last cursor character and the current cursor character
Alt + f jumps to the end of the word where the cursor is located

replace
ctrl + t replaces the current character with the previous character
Alt + t swaps the word where the cursor is currently located and the word before the cursor
alt + u capitalize the word at the cursor position
alt + l changes the word at the cursor's current position to lowercase
Alt + c capitalizes the first letter of the word at the cursor's current position
^oldstr^newstr replaces the string in the previous command

History command editing
ctrl + p returns to the last input command character
ctrl + r Enter word search history command
alt + p Enter a character to search for history commands similar to the character
alt + > Return to the last executed command

other
ctrl + s locks the terminal
ctrl + q unlocks the terminal
ctrl + l clears the screen, equivalent to the command clear
ctrl + c starts a new line
ctrl + i is similar to TAB key completion function
ctrl + o repeat command
Alt + number keys: number of operations

Practical operation:
#c+l clear screen first
minuit@suse:~>str1 str2 str3 #Enter three words. If the first word needs to be capitalized, press c+a to jump to the beginning and press a+c

minuit@suse:~> Str1 str2 str3 #Okay, now the word looks like this. I also found that the second word needs to be capitalized (this command is really annoying: () Okay, if your cursor is currently on the second word, just press a+u to change the word. If not, press c+a and then c+f to jump to the second word, then press a+u again. The result is as shown below.

minuit@suse:~> Str1 STR2 str3 #I want to switch, what should I do? I am already in the last word. This is easy. Press a+2+b and jump to the second word. Then press a+l. Now the second word is all lowercase.

minuit@suse:~> welcome to chinaunix! #Isn't it just changing the case? Press c+a and then a+3+c to see the effect
minuit@suse:~> Welcome To Chinaunix! #GOOD It's very simple. Let's try to replace it again.
minuit@suse:~> Welcome To Chinaunix! #Still these three words c+a jumps to the beginning and then jumps to the second word (because a+t can only replace the previous word, so you can't press a+t on the first word) press and hold a+t
minuit@suse:~> To Welcome Chinaunix! #Now it looks like this. If I press a+2+t again, it will change to another shape.
minuit@suse:~> Chinaunix! Welcome To #Okay, let's get started with some more commonly used
minuit@suse:~>ls /tmp/ #see what's there
file1 file2 file3 ..... ..
minuit@suse:~>^ls^cd #Now if you want to enter the directory again, just type in the replacement command. This can save a lot of time pressing a+b or a+f when the command is long.
cd /tmp/
minuit@suse:/tmp> #I have entered the tmp directory. I won't try the jump command. You can try it yourself and you won't see it.^_^

--------------------------------------------------------------------------------------------
Ctrl + a can quickly switch to the beginning of the command line
Ctrl + e switches to the end of the command line
Ctrl + r Search in history command
Ctrl + u deletes all characters before the cursor position
Ctrl + k deletes all characters after the cursor position
ctrl + w delete the word before the cursor
Ctrl + d ends the current input and exits the shell
ctrl + s can be used to stay on the current screen ctrl + q resumes refreshing the screen
ctrl + l clear screen

CTRL key related shortcuts:

Ctrl + a - Jump to the start of the line
Ctrl + b - Move back a char
Ctrl + c - Terminate the command //This is the most used one, right?
Ctrl + d - Delete from under the cursor
Ctrl + e - Jump to the end of the line
Ctrl + f - Move forward a char
Ctrl + k - Delete to EOL
Ctrl + l - Clear the screen //Clear the screen, similar to the clear command
Ctrl + r - Search the history backwards //Search history commands
Ctrl + R - Search the history backwards with multi occurrence
Ctrl + u - Delete backward from cursor // Useful when the password is entered incorrectly
Ctrl + xx - Move between EOL and current cursor position
Ctrl + x @ - Show possible hostname completions
Ctrl + z - Suspend/ Stop the command
Replenish:
Ctrl + h - Delete the current character
Ctrl + w - Delete the last word typed

ALT key related shortcuts:

Rarely used. Some of them conflict with remote login tools.

Alt + < - Move to the first line in the history
Alt + > - Move to the last line in the history
Alt + ? - Show current completion list
Alt + * - Insert all possible completions
Alt + / - Attempt to complete filename
Alt + . - Yank last argument to previous command
Alt + b - Move backward
Alt + c - Capitalize the word
Alt + d - Delete word
Alt + f - Move forward
Alt + l - Make word lowercase
Alt + n - Search the history forwards non-incremental
Alt + p - Search the history backwards non-incremental
Alt + r - Recall command
Alt + t - Move words around
Alt + u – Make word uppercase
Alt + back-space - Delete backward from cursor
// This is useful if SecureCRT is not configured correctly.

Other special key bindings:

Type bind -P to view all keyboard bindings. I think this series is more practical.

Here "2T" means Press TAB twice
$ 2T - All available commands (common) // Command line completion, which I think is the best thing about Bash
$ (string)2T - All available commands starting with (string)
$ /2T - Entire directory structure including Hidden one
$ ./2T - Only Sub Dirs inside including Hidden one
$ *2T - Only Sub Dirs inside without Hidden one
$ ~2T - All Present Users on system from "/etc/passwd" //First time seeing this, very useful
$ $2T - All Sys variables // Very useful when writing Shell scripts
$ @2T - Entries from "/etc/hosts" //First time seeing
$ =2T - Output like ls or dir //It seems not as good as ls Quick supplement:
Esc + T - swap the two words in front of the cursor

Table 2-1 Keystrokes for navigating the command line

Keystrokes

Full name

meaning

Ctrl+F

Character forward

Move forward one character

Ctrl+B

Characters backwards

Move back one character

Alt+F

Word forward

Move forward one word

Alt+B

Word backwards

Move back one word

Ctrl+A

Outfit

To the beginning of the current line

Ctrl+E

End of line

To the end of the line

Ctrl+L

Clear screen

Clear the screen and leave a line at the top of the screen

The keystrokes in Table 2-2 can be used to edit the command line.

Table 2-2 Keystrokes for editing command lines

Keystrokes

Full name

meaning

Ctrl+D

Delete current content

Delete the current character

Backspace or Rubout

Delete previous content

Delete the previous character

Ctrl+T

Transpose characters

Swap the position of the current character with the previous character

Alt+T

Swap words

Swap the position of the current word with the previous word

Alt+U

Capitalize words

Capitalize the current word

Alt+L

Lowercase words

Make the current word lowercase

Alt+C

Capitalize the first letter

Capitalize the first letter of the current word

Ctrl+V

Insert special characters

Add special characters. For example, press Ctrl+V+Tab to add a Tab character.

Use the keystrokes in Table 2-3 to cut and paste text on the command line.

Table 2-3 Keystrokes for cutting and pasting text on the command line

Keystrokes

Full name

meaning

Ctrl+K

Cut end of line

Cut text to the end of the line

Ctrl+U

Cut line header

Cut text to the beginning of the line

Ctrl+W

Cut the previous word

Cut the word before the cursor

Alt+D

Cut next word

Cut the word after the cursor

Ctrl+Y

Paste recent text

Paste the most recently cut text

Alt+Y

Paste earlier text

Cycle back to the previously cut text and paste it

Ctrl+C

Delete an entire line

Delete an entire line

Table 2-4 Key combinations for text completion

Key Combinations

Used for

Alt+~

Complete text with username

Alt+$

Completing text with variables

Alt+@

Complete text with hostname

Alt+!

Complete text using command names (aliases, reserved words, shell functions, shell builtins, and file names are checked in that order). In other words, complete this key sequence with previously executed commands

Ctrl+X+/

List possible completions for username text

Ctrl+X+$

List possible completion environment variables

Ctrl+X+@

List possible completed hostnames

Ctrl+X+!

List possible completion command names

Table 2-5 Keystrokes for using the command history

key

Function Name

describe

Arrow keys (↑ or ↓)

Stepping

Press the up and down arrow keys to step through each command line in the history list until you reach the desired position (Ctrl+P and Ctrl+N have the same functions, respectively).

Ctrl+R

Reverse incremental search

After pressing these keys, enter a search string to perform a reverse search. After entering this string, the matching command line will appear and you can run or edit it.

Ctrl+S

Forward incremental search

Similar to the previous function, but it searches forward

Alt+P

Reverse Search

After pressing these keys, enter a string to search in reverse order. Type a string and press Enter to see the most recently used commands containing that string.

Alt+N

Forward Search

Similar to the previous function, but it searches forward

Alt+<

Beginning of the history list

Go to the first item in the history list

Alt+>

End of history list

Go to the last item in the history list

This is the end of this article about how to add shortcut commands to Xshell. For more relevant content about adding shortcut commands to Xshell, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Xshell5 registration code, Xftp5 registration code, Xmanager5 registration code (tested)
  • Solution to garbled Chinese output in remote Linux xshell
  • Xshell implements the method of uploading files from Windows to Linux host
  • Connect to the remote host using the key method based on Xshell
  • xshell upload and download files (Windows, Linux)
  • Tutorial on configuring SSH and Xshell to connect to the server in Linux (with pictures)
  • Python3 simulates the method of implementing xshell remote execution of liunx commands
  • When using Xshell under Windows, msvcr110.dll and other dlls are missing
  • VMware10.0.7 installs centos6.3 and connects to xshell
  • Ensure Linux VPS and server security Xshell set up key login
  • Detailed explanation of the idea of ​​xshell remote login to CentOS7 without password login

<<:  In-depth explanation of the style feature in Vue3 single-file components

>>:  Detailed tutorial on installing MySQL 8.0.20 database on CentOS 7

Recommend

VMwarea virtual machine installation win7 operating system tutorial diagram

The installation process of VMwarea will not be d...

js implements mouse in and out card switching content

This article shares the specific code of js to re...

Overview of the Differences between Linux TTY/PTS

When we type a letter on the keyboard, how is it ...

How to use an image button as a reset form button

When we make a form, we often set a submit button ...

MySQL log settings and viewing methods

MySQL has the following logs: Error log: -log-err...

HTML Tutorial: Collection of commonly used HTML tags (5)

These introduced HTML tags do not necessarily ful...

Example of how to configure nginx in centos server

Download the secure terminal MobaXterm_Personal F...

Vue implements the browser-side code scanning function

background Not long ago, I made a function about ...

Common problems in implementing the progress bar function of vue Nprogress

NProgress is the progress bar that appears at the...

Nginx Layer 4 Load Balancing Configuration Guide

1. Introduction to Layer 4 Load Balancing What is...

Node implements search box for fuzzy query

This article example shares the specific code for...

How to change the database data storage directory in MySQL

Preface The default database file of the MySQL da...

Let's deeply understand the event object in js

We know that the commonly used events in JS are: ...

How to delete extra kernels in Ubuntu

Step 1: View the current kernel rew $ uname -a Li...

Implementation of CSS child element selection parent element

Usually a CSS selector selects from top to bottom...