Laughing Hyena
  • Home
  • Hyena Games
  • Esports
  • NFT Gaming
  • Crypto Trends
  • Game Reviews
  • Game Updates
  • GameFi Guides
  • Shop
Tag:

terminal

Manage Linux Network Connections
Gaming Gear

How to manage Linux network connections via nmcli and the terminal

by admin June 14, 2025



We take graphical user interfaces (GUIs) for granted. They generally “just work” and we can largely go about our business without even thinking. The Linux networking GUI is very much now in this camp. We were there when networking with Linux was a chore, heck we remember setting up PPP to connect to the Internet via a modem, in Linux!

What happens when things go wrong? The GUI breaks down, or were left with just a Linux terminal? Perhaps we are installing Linux on a server with no GUI? In these circumstances we need to understand how to make, break and configure connections using the nmcli command.

The nmcli command is one of many command-line tools to manage your network connections, and in this how to we will use it to check the connections on a system, bring connections down (off) and up (on) and finally we shall create a static IP address.


You may like

Working with an Interface

Interfaces are our points of connection. They can be physical, for example Ethernet, or they can be radio based, Wi-Fi for example. Each interface has a unique name, to identify whether it is Ethernet or Wi-Fi. In the past these names were generic, eth0 for the first Ethernet connection and wlan0 for Wi-Fi. In more recent years, these interface names have changed to be more specific.

Our first task is to identify the available interfaces.

1. Open a terminal and list all of the available connection / interfaces. The nmcli command can be used on its own, but passing the -p option will produce a “prettier” output.

nmcli -p

(Image credit: Future)

2. The output for the previous command will show all of the connections / interfaces. To return just the active interface connections use this command. Again, using the -p option provides a clearer view of the output.

Get Tom’s Hardware’s best news and in-depth reviews, straight to your inbox.

nmcli -p dev status

(Image credit: Future)

3. Use this command to get the details of a specific connection. Remember to change the name of the connection to match the output of the previous command. There is a lot of output, and you can pipe the output of the command using grep to pick out specific details.

nmcli -p con show

(Image credit: Future)

4. Use this command to determine the default gateway for your connection. The default gateway is typically our home router, the hardware that enables us to connect to the Internet. The output should show the ipv4 and ipv6 gateway details.

nmcli -p con show | grep GATEWAY

(Image credit: Future)

5. To bring a connection down (disable / disconnect) use this command. This will disconnect your Linux device from the network. Remember to replace the connection name with your connection name.

nmcli -p con down

(Image credit: Future)

6. List the connections, this will show that your device is no longer connected to the network.

nmcli -p dev status

(Image credit: Future)

7. Bring the connection up using this command. Remember to change the connection name.

nmcli -p con up

(Image credit: Future)

Setting a static IP address

For many of us, a dynamically assigned IP address from our router is all we need to get online. What if we want to create a server? A server will need a static IP address to enable connecting devices to find it.

We’re going to use nmcli to modify the connection so that we have a specific IP address.

We’re using an Ubuntu LTS, but the instructions will also work on a Raspberry Pi running Raspberry Pi OS, or any other Debian / Ubuntu based machine.

1. Open a terminal and using nmcli set the connection details. The connection name is as we have used above. The required IP address is as per your requirements, but it should be within the range offered by the device. The gateway is typically the IP address of the router. The DNS server can be your router

nmcli connection modify “CONNECTION NAME” \
ipv4.addresses REQUIRED IP ADDRESS/24 \
ipv4.gateway YOUR GATEWAY \
ipv4.dns YOUR DNS SERVER \
ipv4.method manual

2. Bring the connection down. Remember to use your connection name.

nmcli -p con down

3. Now bring the connection back up. Remember to use your connection name.

nmcli -p con up

4. Check that the connection has been made correctly. The State column should show “connected”.

nmcli -p dev status

(Image credit: Future)

6. Check your IP address. Using the connection show command we pipe the output through grep, looking for “ipv4.addresses”.

nmcli -p con show <> | grep ipv4.addresses

(Image credit: Future)

7. Finally ping an IP address to ensure that your server can reach the outside world. You should see pings being sent within a few milliseconds, if there is a problem then the command will error. Press CTRL + C to end the ping command. We typically use Google’s DNS server IP address 8.8.8.8, but you can also use CloudFlare’s 1.1.1.1 or OpenDNS 208.67.222.123. Alternatively, you can ping a URL such as google.com.

ping 8.8.8.8

(Image credit: Future)

More Linux Tutorials

🐧 How To Dual Boot Linux and Windows 11

🐧 How to Create Custom Grub Menu Backgrounds for Linux Boots

🐧 How to Use Nohup to Run Linux Scripts Unattended

🐧 How To Find Large Files on Linux

🐧 How To Mount and Unmount Drives on Linux

🐧 How To Manage Users in Linux



Source link

June 14, 2025 0 comments
0 FacebookTwitterPinterestEmail
Process management via the Linux terminal
Gaming Gear

How To Kill a Process in the Linux terminal

by admin June 9, 2025



In this how-to we’ll look at various ways of using the terminal emulator to identify processes and how to kill them. A process can be an application or script running on your Linux machine. Sometimes a process can crash or become a memory hog and this is when we need to step in and “kill” the process. As ever, there are a multitude of tools that we can use to do this. We will use a variety of approaches and tools to identify and kill the processes.

While you become accustomed to these commands, it’s important to take care that you don’t kill a process which results in you losing work. Wherever possible use an application that isn’t currently in use on your machine as an example of a process to kill.

All the commands in this how-to will work on most Linux machines. We’ve used a Ubuntu 20.04 install but you could run this how-to on a Raspberry Pi. All of the how-to is performed via the Terminal. You can open a terminal window on most Linux machines by pressing ctrl, alt and t.


You may like

How to Kill a Known Application in Linux 

(Image credit: Tom’s Hardware)

To begin, let’s open a software application and then, in the terminal, use the killall command to kill the application. We have used Inkscape, the free and open source vector graphics package as an example, but it doesn’t really matter what you use, just so long as you aren’t depending on it for anything at the current time.

Using the killall command kills all processes linked to the named application. Later we will look at using the kill command to kill a specific process.

1. Launch Inkscape, or another test application, from the system gui.

2. In the terminal, use the killall command to kill all Inkscape processes. You should see that Inkscape closes immediately when this command is issued.

Get Tom’s Hardware’s best news and in-depth reviews, straight to your inbox.

killall inkscape

Identifying Different Processes in Linux

(Image credit: Tom’s Hardware)

Often, software applications have numerous processes running and it can be useful to try and work out which one is likely causing the problem. For example, it could be one browser window rather than all of Chromium or Firefox.Then you can close the problematic process while leaving the rest of the app running. We can use the top tool in the terminal to look at, interact and then kill the rogue processes.

1. Launch the top tool in the terminal. When it’s launched, you will see the terminal populate with information regarding all the processes and their status. The second line of the top screen shows the total number of tasks, which are currently running and which are sleeping, stopped or zombie status. Below this you will see a list of processes and this information will refresh at a default of once every three seconds.

top

2. Press i to constrain the current processes list to those currently active. This can be very useful if you are only interested in current running processes and makes the list easier to read.

3. Press z to add color to the top interface to make it easier to read. Because this is a text based interface, adding color can help distinguish between labels and data.

4. Launch Inkscape or another non essential application.

5. Find the listing for Inkscape and note the PID. The PID is the number assigned to identify the process and they are listed in the first column of the top output. In our example the PID for inkscape was 4582 but it will be different each time Inkscape is running.

6. Press k and then type the PID number to kill the process.

7. Press ENTER and you should see a message “Send pid 4582 signal [15/sigterm]” which is confirming you want to kill this process. Press “enter” once more to confirm and kill the process.

8. Press q to close top and return to the terminal emulator. Often, you will want to look at top for a quick glimpse at the processes and then return to the terminal.

Killing an Individual Process Outside of top

(Image credit: Tom’s Hardware)

Occasionally you might want to kill an individual process outside of top. We can use the PID number found via top in combination with the kill command to do this. Note that the killall command we used earlier won’t work with an individual PID.

1. Launch Inkscape or another application. The choice of application doesn’t really matter, just make sure you aren’t working in the application.

2. Launch top in the terminal. Press i and z to constrain the results and add color to the top theme.

top

3. Identify and note the PID for the application to kill. In our example the PID for Inkscape was 4582.

4. Exit top by pressing q.

5. Use the kill command and the PID number to kill the Inkscape process from the terminal emulator. Replace the example PID value below with your own identified PID.

kill 4582

Using top provides an excellent set of detective tools to identify misbehaving processes and can often allow you to clinically close an unresponsive process whilst possibly saving other data in an application.

Killing Processes Using the ps Process Report

There is an alternative to top. We can use the ps command, designed to produce a report of all the running processes.

1. Launch Inkscape or another application. The choice of application doesn’t really matter, just make sure you aren’t working in the application.

2. Run the ps command with two arguments. The -e argument shows all the processes and the -f argument sets the format to the system standard syntax.

ps -ef

(Image credit: Tom’s Hardware)

3. Use grep to filter the report. searching just for “inkscape”. The typical ps -ef output is extremely dense, packed with dozens of running processes. Using a filter we can search for the application name. The PID is the second column, just after the username. You may see multiple PIDs for the application.The one that we are interested in just shows the application name.

ps -ef | grep inkscape

(Image credit: Tom’s Hardware)

4. Use the kill command along with the PID to kill the process. In our case Inkscape had a PID of 19166.

kill 19166

Process management is a key Linux skill to learn and it’s worth taking the time to practice these approaches before you need to deploy them in a real situation.



Source link

June 9, 2025 0 comments
0 FacebookTwitterPinterestEmail
Searching for files with the Linux terminal
Product Reviews

How To Find Files in the Linux terminal

by admin June 9, 2025



In this how-to, we’ll look at various ways of using the find command to help us find files and directories across the Linux filesystem. Sometimes we misplace a file or directory and we can spend precious time searching via the terminal. On the Linux desktop, the file manager will have a builtin search tool, as does the terminal. The find command is immensely useful, and exceptionally easy to use.

Whilst you become accustomed to these commands, it’s good to work with test files and directories and you should take extra care to ensure you are carefully following the instructions.

All the commands in this how-to will work on most Linux machines. We’ve used an Ubuntu LTS install but you could run this how-to on a Raspberry Pi. All of the how-to is performed via the Terminal. You can open a terminal window on most Linux machines by pressing ctrl, alt and t.


You may like

Finding a File in Linux

(Image credit: Tom’s Hardware)

To begin, let’s create some example files in a directory and then use the find command to find them.

1. Create a test folder containing test files. After creating the test directory and files check the files have been created using ls.

mkdir test
cd test
touch test1.txt test2.h test3.c TEST.f
ls

2. In the test directory, find the file called test1.txt. Using find with “.” indicates that the search should be confined to the current working directory. After running the find command you should see the test1.txt file listed as a result.

find . -name test1.txt

Searching Using a Partial Filename in Linux

(Image credit: Tom’s Hardware)

On occasion, we may need to search using partial file or directory names. Let’s look at how to do this and how searching for partial terms affects the results.

Get Tom’s Hardware’s best news and in-depth reviews, straight to your inbox.

1. In the test directory run the following command searching for files that contain the term “tes” within their name.

find . -name “*tes*”

In the list of results, you should see that all the files have been found and listed apart fromTEST.f , this is due to -name returning case sensitive results. We’ll look at an alternative that returns non case sensitive results in a later section.

2. Repeat the command searching for a specific file extension. We can use the same method to search for a particular file type. Changing the command to search for“*.txt*” will return only the .txt filetype.

find . -name “*.txt*”

3. Use -iname to return non-case sensitive results. Here we use the partial search term“*tes*” again but using -iname forces the command to show all results regardless of upper or lower case. Therefore the results include our file TEST.f .

find . -iname “*tes*”

Distinguishing Between Directories and Files in Linux

(Image credit: Tom’s Hardware)

In its standard form, the find command will also return any matching results regardless be they files or directories. We can also add tags to the find command that force the command to only return files or only return directory results.

1. Add a directory inside our test directory called test2. Use ls to confirm that the directory has been created.

cd test
mkdir test2
ls

2. Run a find command that will return both file and directory results. You should see that the result contains all the test files and also the test2 directory.

find . -iname “*test*”

3. Add the -type f tag to return only file results. Note that in the results the directory test2 is omitted.

find . -iname “*test*” -type f

4. Add the -type d tag to return only directory results. Note that the only result now should be the test2 directory.

find . -iname “*test*” -type d

Searching the Entire Filesystem in Linux

(Image credit: Tom’s Hardware)

You may need to search the entire filesystem to try and find a misplaced or forgotten file.

1. Search for the test1.txt file from the root (/) of the filesystem. This step isn’t tremendously successful and has been added to illustrate a common issue.

cd
find / -iname test1.txt

You will find that you don’t have permission to search in a lot of areas, this results in a long reported list of areas we can’t search and, although our test1.txt file has been located we need to search through the report list to find it. Notice in this example we use / to enable the command to search all sub directories.

(Image credit: Tom’s Hardware)

2. Repeat the previous search but use sudo to add root privileges. This then gives the command permission to access most places within the filesystem and as such the returned report will be much clearer and easier to read.

sudo find / -iname test1.txt

With these examples you should now have a basic tool set to find any file anywhere on your system, even if you only know a part of its name.



Source link

June 9, 2025 0 comments
0 FacebookTwitterPinterestEmail

Categories

  • Crypto Trends (665)
  • Esports (504)
  • Game Reviews (476)
  • Game Updates (596)
  • GameFi Guides (666)
  • Gaming Gear (648)
  • NFT Gaming (643)
  • Product Reviews (645)
  • Uncategorized (1)

Recent Posts

  • “It was like a Christmas holiday present.” Digital Eclipse on the deal that got it Mortal Kombat
  • Bitcoin Scandal Fails to Topple Czech Government in No-Confidence Vote
  • Everything We Learned During Today’s Donkey Kong Bananza Direct
  • Wordle today: Answer and hint #1461 for June 19
  • I played the challenging new online football game coming to Xbox Game Pass that’s been likened to Rocket League and was immediately transported back to my school’s playground

Recent Posts

  • “It was like a Christmas holiday present.” Digital Eclipse on the deal that got it Mortal Kombat

    June 19, 2025
  • Bitcoin Scandal Fails to Topple Czech Government in No-Confidence Vote

    June 19, 2025
  • Everything We Learned During Today’s Donkey Kong Bananza Direct

    June 19, 2025
  • Wordle today: Answer and hint #1461 for June 19

    June 19, 2025
  • I played the challenging new online football game coming to Xbox Game Pass that’s been likened to Rocket League and was immediately transported back to my school’s playground

    June 19, 2025

Newsletter

Subscribe my Newsletter for new blog posts, tips & new photos. Let's stay updated!

About me

Welcome to Laughinghyena.io, your ultimate destination for the latest in blockchain gaming and gaming products. We’re passionate about the future of gaming, where decentralized technology empowers players to own, trade, and thrive in virtual worlds.

Recent Posts

  • “It was like a Christmas holiday present.” Digital Eclipse on the deal that got it Mortal Kombat

    June 19, 2025
  • Bitcoin Scandal Fails to Topple Czech Government in No-Confidence Vote

    June 19, 2025

Newsletter

Subscribe my Newsletter for new blog posts, tips & new photos. Let's stay updated!

@2025 laughinghyena- All Right Reserved. Designed and Developed by Pro


Back To Top
Laughing Hyena
  • Home
  • Hyena Games
  • Esports
  • NFT Gaming
  • Crypto Trends
  • Game Reviews
  • Game Updates
  • GameFi Guides
  • Shop

Shopping Cart

Close

No products in the cart.

Close