×


Blog


Automatically Empty the Trash in Ubuntu 20.04 - How to do this ?

This article covers how to install Autotrash on Ubuntu system. With Autotrash, you can automatically delete the files residing in the Trash based on the conditions you specified.

trash-cli is a command-line interface to the trash-can used by Linux Systems. 

The trash-cli is present in repositories of most of the Linux Distributions.


To remove Autotrash from Ubuntu:

Run the command:

$ sudo snap remove autotrash-unofficial


Change Host Name on Ubuntu 20.04 - How to perform this task ?

This article covers both the CLI and GUI based methods of changing the hostname on Ubuntu 20.04. 

To change the hostname on Ubuntu Linux:

1. Type the following command to edit /etc/hostname using nano or vi text editor: $ sudo nano /etc/hostname. Delete the old name and setup new name.

2. Next Edit the /etc/hosts file: sudo nano /etc/hosts.

3. Reboot the system to changes take effect: sudo reboot.


To change the hostname on Ubuntu:

1. To change the hostname invoke the hostnamectl command with the set-hostname argument followed by the new hostname. 

2. Only the root or a user with sudo privileges can change the system hostname. 

3. The hostnamectl command does not produce output.


To change the localhost hostname (static name in the hostname file)?

1. You can also set the static hostname manually by editing /etc/hostname

2. This file contains exactly one line by default. 

3. If you have not changed the hostname yet, then that line probably reads localhost. localdomain .


To display the current Ubuntu hostname:

Simply type the following command:

$ hostnamectl


To change Ubuntu LTS hostname permanently:

1. Type the hostnamectl command :

$ sudo hostnamectl set-hostname newNameHere

2. Delete the old name and setup new name.

3. Next Edit the /etc/hosts file:

$ sudo nano /etc/hosts

Replace any occurrence of the existing computer name with your new one.

4. Reboot the system to changes take effect:

$ sudo reboot


To change hostname on Ubuntu without a system restart:

1. Let us see current setting just type the following command:

$ hostnamectl

2. Next change hostname from localhost to linuxapt, enter:

$ hostnamectl set-hostname linuxapt

3. Verify new changes:

$ hostnamectl


Install ClamAV Anti-Malware Protection on Ubuntu 20.04 - How to do this ?

This article covers how to install and configure ClamAV and ClamTK to scan for malware on Ubuntu 20.04. 

There aren't many viruses made for Linux distributions and as such, most people who use such systems don't even bother using antivirus software. 

Those however who do want to be able to scan their system or other Windows-based systems that are connected to a Linux PC through a network can use ClamAV. 

ClamAV is an open-source anti-virus engine that is built to detect viruses, trojans, malware, and other threats. 

It supports multiple file formats (documents, executables, or archives), utilizes multi-thread scanner features, and receives updates for its signature database at least 3-4 times a day.


To ClamAV Antivirus on Ubuntu:

The first step is to install and get the latest signature updates. To do this on Ubuntu, you can open a terminal and insert "sudo apt-get install clamav" and press enter.

$ sudo apt install clamav

You may also build ClamAV from sources to benefit from better scanning performance.

To update the signatures, you type "sudo freshclam" on a terminal session and press enter.

$ sudo freshclam

Now we are ready to scan our system. 

To do this, you can use the "clamscan" command. 

This is a rich command that can work with many different parameters so you'd better insert "clamscan –-help" on the terminal first and see the various things that what you can do with it:

$ clamscan –-help


To Update ClamAV Signature Database:

1. Stop the ClamAV process:

$ systemctl stop clamav-freshclam

2. Manually update the ClamAV signature database:

$ freshclam

3. Restart the service to update the database in the background:

$ systemctl start clamav-freshclam


Install Microsoft PowerShell in Ubuntu 20.04 - How to perform this task ?

This article covers the different methods for installing Microsoft PowerShell on Ubuntu which includes installation via package repository, via .deb package, and via snap. 

PowerShell for Linux is published to package repositories for easy installation and updates. 

As superuser, register the Microsoft repository once. 

After registration, you can update PowerShell with sudo apt-get install powershell.


To install PowerShell on Ubuntu 20.04:

PowerShell for Linux is published to package repositories for easy installation and updates.

So do the following;

1. # Update the list of packages.

$ sudo apt-get update

2. # Install pre-requisite packages.

$ sudo apt-get install -y wget apt-transport-https software-properties-common

3. # Download the Microsoft repository GPG keys.

$ wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb

4. # Register the Microsoft repository GPG keys.

$ sudo dpkg -i packages-microsoft-prod.deb

5. # Update the list of products.

$ sudo apt-get update

6. # Enable the "universe" repositories.

$ sudo add-apt-repository universe

7. # Install PowerShell.

$ sudo apt-get install -y powershell

8. # Start PowerShell.

$ pwsh

As superuser, register the Microsoft repository once.

After registration, you can update PowerShell with sudo apt-get install powershell.


To remove PowerShell from Ubuntu:

Run the command,

$ sudo apt-get remove powershell


How to Launch PowerShell on Linux or Mac?

1. Open a terminal and run the "powershell" command to access a PowerShell shell environment. 

2. This works on both Linux and Mac–whichever you're using. 

3. You'll see a PowerShell prompt beginning with "PS", and you can run PowerShell cmdlets just as you would on Windows.


Find out Which Groups a User Belongs to in Ubuntu 20.04 - How to do it ?

This article covers how you can easily find out which groups a user belongs to in Ubuntu. Also we shared how to list all groups in a system, list members of a group, add and remove a user from the group. For information about adding/removing users in a system, visit our guide on how to add and remove users on Ubuntu .

Adding a user to an existing group is one of the typical tasks of a Linux administrator.

A group is a collection of users. 

The main purpose of the group is to define a set of privileges to their members within the group.


To find out if a user has sudo access is by checking if the said user is member of the sudo group. 

If you see the group 'sudo' in the output, the user is a member of the sudo group and it should have sudo access.

In order to list groups on Linux, you have to execute the "cat" command on the "/etc/group" file. 

When executing this command, you will be presented with the list of groups available on your system.


To login as Sudo on Ubuntu:

1. Open a terminal Window. Press Ctrl + Alt + T to open the terminal on Ubuntu.

2. To become root user type: sudo -i. sudo -s.

3. When promoted provide your password.

4. After successful login, the $ prompt would change to # to indicate that you logged in as root user on Ubuntu.


What is /etc/passwd file?

"/etc/passwd" is a text file containing every user information that is required to login to the Linux system. It maintains useful information about users such as username, password, user ID, group ID, user information, home directory and shell.


To find out which groups a user belongs to in Linux:

1. groups: Show All Members of a Group.

2. id: Print user and group information for the specified username.

3. lid or libuser-lid: It display user's groups or group's users.

4. getent: Get entries from Name Service Switch libraries.

5. compgen: compgen is bash built-in command and it will show all available commands for the user.

6. members: List members of a group.

7. /etc/group file: Also, we can grep the corresponding user’s groups from the /etc/group file.


What is Wheel Group in Linux?

The wheel group is a special user group used on some Unix systems, mostly BSD systems, to control access to the su or sudo command, which allows a user to masquerade as another user (usually the super user). Debian-like operating systems create a group called sudo with purpose similar to that of a wheel group.


Types of groups in Linux:

1. Primary Group - The primary group is the main group associated with the user account. Each user must be a member of a single primary group.

2. Secondary Group - The secondary or supplementary group is used to grant additional rights to the user. Each user can become a member of multiple secondary groups.


Install Plex Media Server on Ubuntu 20.04 - Step by step process to get this done ?

This article covers the installation of the Plex media server on Ubuntu. Using the Plex, you can save all your favorite Tv shows, movies, videos, and photos in a single place. You can approach them from anywhere to any device. 


To install Plex Media Server on Ubuntu:

1. Download the .deb package

2. run sudo dpkg -i plexmediaserver_1.19.4.2935-79e214ead_amd64.deb (replacing the last filename with the name of the package you downloaded)

3. To setup Plex Media Server, on the same machine you installed the server on, open a browser window, and go to http://127.0.0.1:32400/web.


To Enable and start Plex media server on Ubuntu:

Execute the following command as sudo: $ sudo systemctl start plexmediaserver.service.