码迷,mamicode.com
首页 > 其他好文 > 详细

10 Awesome PuTTY Tips and Tricks You Probably Didn’t Know

时间:2020-04-16 01:01:51      阅读:291      评论:0      收藏:0      [点我收藏+]

标签:war   com   discus   col   ftp   format   bec   oba   ext   

PuTTY Trick 1: Delete All PuTTY Sessions Together

When you are swapping an old computer with a new computer, you may end-up transferring all PuTTY sessions to new computer. Once you’ve transferred all PuTTY sessions, execute “putty -cleanup” from the command line as shown below.

C:>putty -cleanup

This will display following warning message. Click on ‘Yes’ to wipe-out all PuTTY session and random seed files from the Windows registry. This is a better process to delete all saved PuTTY sessions from Windows registry instead of deleting one-by-one from the PuTTY session list.

技术图片

Fig: PuTTY Cleanup Sessions

PuTTY Trick 2: Change Font Size Automatically when Resizing PuTTY Window

By default when you resize a PuTTY window, the font size doesn’t change. Sometimes it would be good if font size decrease when you reduce the PuTTY window size (or) font size increase when you increase the PuTTY window size.

 

For example, when you are running Unix top command, if you try to resize the window, the output will get cut-off in the PuTTY as shown below.

技术图片

Fig: Partial output truncated during PuTTY window resize

Launch PuTTY -> Select a Session -> Click on Load. From left side tree menu click on Window -> select the “Change the size of the font” under “When window size is resized” section as shown below -> Click on ‘Open’ at the bottom of this window to start the session.

技术图片

Fig: PuTTY Change the font size automatically

After the above change, start the PuTTY SSH session and login again. Start the Unix top command and try to resize the window. When you reduce the window size, the font size will become smaller and adjust the top command output automatically to fit in the small size screen as shown below.

技术图片

Fig: Unix top command output not truncated

Note: Instead of automatically adjusting the font size during window resize, you can also set the following options “When window is resized” from the PuTTY configuration window.

  • Change the number of rows and columns.
  • Change the size of the font. (this is the option we discussed in this tip)
  • Change font size only when maximized.
  • Forbid resizing completely. (This option can be very helpful, when you don’t want PuTTY window resizing to happen)

PuTTY Trick 3: Change the PuTTY SSH Session Window Title

By default, PuTTY software displays “username@hostname:~” in the PuTTY window title after you login. You can change this to any user-friendly text.

Launch PuTTY -> Select a Session -> Click on Load. From left side tree menu click on Window -> Behavior. On the right panel, in the ‘Window Title’ text box enter the desired windows title as shown below. After this change, make sure to save the session.

技术图片

Fig: Custom Window Title for PuTTY Session

Load this saved PuTTY SSH session and login again to the server, which will display the new updated window title as shown below.

技术图片

Fig: PuTTY Session showing user defined custom window title

PuTTY Trick 4: View PuTTY Event log

When you are logged-in to a PuTTY SSH session, right mouse-click on the PuTTY window title, which will display PuTTY menu. Select ‘Event Log’ menu-item, which will display the following PuTTY event log window.

This will be very helpful to debug any PuTTY SSH session issues.

技术图片

Fig: PuTTY Event Log Display

PuTTY Trick 5: Paste to Clipboard in Rich Text Editor (RTF) Format

Typically when you copy/paste from PuTTY window to a word document, it will paste only in plain text as explained below.

  • Login to PuTTY Telnet or SSH session without setting the ‘Paste to clipboard in RTF’ option that was explained below.
  • Execute ‘man ssh’ from the command line.
  • Copy the first few lines of the man output.
  • Launch Microsoft Word and paste the output. You’ll see only the text output without any formatting.

Enable the RTF copy/paste feature in PuTTY software as shown below.

Launch PuTTY terminal -> Select a Session -> Click on Load. From left side tree menu click on Window -> Selection. On the right panel, select the check-box where it says “Paste to clipboard in RTF as well as plain text” as shown in the image below.

技术图片

Fig: Enable Rich Text Paste to Clipboard in PuTTY

  • Login to PuTTY telnet or SSH session after setting the ‘Paste to clipboard in RTF’ option that was explained above.
  • Execute ‘man ssh’ from the command line.
  • Copy the first few lines of the man output.
  • Launch Microsoft Word and paste the output. You’ll see only the text output getting copied with all the format as shown below.
技术图片

Fig: Rich Text copied from PuTTY to MS-Word with formatting

PuTTY Trick 6. Make PuTTY SSH Session Always Stay On Top

Sometimes when you are running a monitoring session (for example, unix top command), you may want the PuTTY client window to stay on top all the times.

Launch PuTTY terminal -> Select a Session -> Click on Load. From left side tree menu click on Window -> Behavior. On the right panel, click on the check-box where it says “Ensure window is always on top” as shown below.

技术图片

Fig: PuTTY Window Behavior - Always on Top

After this change, login to the PuTTY FTP or SSH or telnet session. This particular session will always stay on top irrespective of any other application you open in the windows.

PuTTY Trick 7: Launch PuTTY Client In Full Screen Mode

Following are the two methods to launch PuTTY client in full screen mode.

Method 1: When the PuTTY client session is running, right mouse-click on the window title and select ‘Full Screen’ (or)

Method 2: Launch PuTTY -> Select a Session -> Click on Load. From left side tree menu click on Window -> Behavior. On the right panel, click on the check-box where it says “Full Screen on Alt Enter” as shown below.

技术图片

Fig: Press Alt-Enter for PuTTY Full Screen

After this change, when the PuTTY terminal session is running, press Alt Key + Enter Key to run that particular PuTTY session in full screen.

PuTTY Trick 8: Launch PuTTY Window Maximized by Default

 

PuTTY Trick 9. Move Putty sessions to another computer

 

PuTTY Trick 10: Launch Most frequently Used PuTTY Session Quickly

 

https://www.thegeekstuff.com/2009/07/10-practical-putty-tips-and-tricks-you-probably-didnt-know/

10 Awesome PuTTY Tips and Tricks You Probably Didn’t Know

标签:war   com   discus   col   ftp   format   bec   oba   ext   

原文地址:https://www.cnblogs.com/ls1519/p/12709572.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!