Changing the Default Terminal to Terminator on Ubuntu

Image
Terminator is a powerful tool for developers, allowing you to manage multiple terminal sessions in a single window. Features like splitting panes, tabs, and simultaneous input can significantly boost your productivity. Step 1: Install Terminator First, install Terminator using the apt package manager. sudo apt update sudo apt install terminator -y The -y option automatically answers 'yes' to any prompts during the installation process, streamlining the setup. Step 2: Set as the System Default Ubuntu uses a utility called update-alternatives to manage default applications. We'll use this tool to change the default terminal emulator ( x-terminal-emulator ) to Terminator. Run the Configuration Command Enter the following command in your terminal. A list of available terminals will appear. sudo update-alternatives --config x-terminal-emulator Select Terminator From the resulting list, enter the selection number corresponding to terminator and press Enter. ...

How to Find and Kill a Process Using a Specific Port on Linux (lsof & netstat)

Introduction

When executing a process, it may fail to start if the port it needs is already occupied by another process. In such cases, you need to find out which process is using that port and either terminate it or modify its configuration.

Using lsof

lsof (List Open Files) is a command in Linux-like systems that displays a list of all open files and the processes that opened them.

Option explanation:

  • -i: Display the listing of files whose Internet address matches the specified address or protocol.

Example: Check if port 22 is in use

lsof -i TCP:22

Output:

COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
sshd    1116 root    5u  IPv4  33907      0t0  TCP *:ssh (LISTEN)
sshd    1116 root    7u  IPv6  33909      0t0  TCP *:ssh (LISTEN)

Using netstat

netstat is a utility that prints network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.

Common options:

  • -l: Display listening sockets
  • -n: Display numerical addresses
  • -p: Display the process ID and name

Example: Check if port 22 is in use

netstat -lnp | grep ':22'

Output:

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1116/sshd
tcp6       0      0 :::22                   :::*                    LISTEN      1116/sshd

Summary

  • Use lsof -i TCP:PORT or netstat -lnp | grep ':PORT' to find which process is using a specific port.
  • Terminate the process using kill <PID> or reconfigure your application to use a different port.

Comments

Popular posts from this blog

Resolving Key Exchange Failure When Connecting with SecureCRT to OpenSSH

SecureCRT] How to Back Up and Restore SecureCRT Settings on Windows

How to Set Up Vaultwarden (Bitwarden) on Synology NAS (Best Free Alternative to LastPass)