×


Category: Docker


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.


Install Emacs Editor in Ubuntu 20.04 - How to perform it ?

This article covers methods to install Emacs editor in the Ubuntu 20.04 system. Emacs is a text editor designed for POSIX operating systems and available on Linux, BSD, macOS, Windows, and so on.


Emacs is an open-source, cross-platform editor that is highly customizable and provides a user-friendly interface to its users. 

It Provide features like multiple editing modes, full Unicode support for scripts, text manipulation tools, and integration with numerous external tools like the shell and git clearly gives an indication of how powerful it is.


To Install Emacs on Linux:

You can check if your Linux system has emacs installed by simply running the following command:

$ emacs

If you get an error message such as "-bash: -bash:: command not found", then you need to install it.

To install the emacs packages, run the command:

$ yum install emacs

On Ubuntu, execute:

$ apt-get install emacs


To install Emacs using Snap on Ubuntu:

Execute the following command in the command line:

$ sudo snap install emacs --classic

Once this is done, you can find Emacs in your list of installed applications.


Free Up Disk Space in Ubuntu 20.04 LTS - How to do this ?

This article covers different effective ways to free up some disk space on your Ubuntu system or other Linux distro. 

Although Linux does not clutter up like Windows, it may be useful to occasionally clean up Linux. Especially in systems with a smaller hard drive it can be beneficial to clean Linux. Occasionally cleaning up Linux does have to be done on a daily basis or weekly basis, 1 time per month is more than sufficient.


Terminal commands to free up some disk space on your Linux System:

There are 3 terminal commands which you can use top clean up Linux Mint. 

Each terminal will be explained about what they do and remove. 

All three commands contribute to free up disk space.

1. sudo apt-get autoclean

This terminal command deletes all .deb files from /var/cache/apt/archives. It basically cleans up the apt-get cache.

2. sudo apt-get clean

This terminal command is used to free up the disk space by cleaning up downloaded .deb files from the local repository.

3. sudo apt-get autoremove

This terminal command used to remove packages that were automatically installed to satisfy dependencies for some package and no longer needed by those packages.


Unzip Files in Linux - How to perform it ?

This article covers how to use the unzip command on the CentOS 8 Linux system.

Also, you will learn various uses of the unzip command through which you can list ZIP archive content and extract files. You can utilize the unzip command according to your needs.


How to Create a ZIP File with the zip Command ?

To create a ZIP file, you need to tell zip the name of the archive file and which files to include in it. 

You don't need to add the ".zip" extension to the archive name, but it does no harm if you do.

To create a file called source_code.zip containing all the C source code files and header files in the current directory, you would use this command:

$ zip source_code *.c *.h


How to Unzip a ZIP File With the unzip Command ?

To extract the files from a ZIP file, use the unzip command, and provide the name of the ZIP file. 

Note that you do need to provide the ".zip" extension.

$ unzip source_code.zip


To Unzip on the Linux command line:

The simplest option that will extract the contents to current directory:

$ unzip backup.zip


To change the target directory for extracted material, use -d option followed by the desired directory:

$ unzip backup.zip -d ./restore-directory


To preview contents of zip file:

$ unzip -l backup.zip


If you don't want to unzip the whole file, then add the specific files to extract at the end:

$ unzip backup.zip file1 subdirectory/file2


The inverse of the above command. Unzip every file EXCEPT the ones specified after the -x modifier:

$ unzip backup.zip -x file1 subdirectory/file2


Unzipping a password protected file:

$ unzip -p mypassword backup.zip