Ubuntu – Command Line

Ubuntu – Command Line ”; Previous Next Ubuntu is a Linux based operating system and most Linux users are more familiar with the command line interface. In this chapter, we will go through some of the popular command line’s used in Ubuntu. Invoking the Command Line To invoke the command line, go to the search option and enter the command keyword in the search box. The search result will give the Terminal option. Double-lick to get the command line as shown in the following screenshot. Directory Listing The easiest command to start with, is the directory listing command which is used to list the directory contents. Syntax ls –option directoryname Parameters Option − These are the options to be specified with the ls command. Directoryname − This is the optional directory name that can be specified along with the ls command. Output The output will be the listing of the directory contents. Example In the following example, we just issue the ls command to list the directory contents. The directory listing of the current directory will be shown as the output. Another variant of the ls command is to list the directory, but with more details on each line item. This is shown in the following screenshot with the ls –l command. Clearing the Screen To clear the screen, we can use the clear command. Syntax clear Parameters None Output The command line screen will be cleared. Command Help To get more information on a command, we can use the ‘man’ command. Syntax man commandname Parameters Commandname − This is the name of the command for which more information is required. Output The information on the command will be displayed. Example Following is an example of the ‘man’ command. If we issue the ‘man ls’ command, we will get the following output. The output will contain information on the ls command. Finding For Files We can use the find command to find for files. Syntax find filepattern Parameters Filepattern − This is the pattern used to find for files. Output The files based on the file pattern will be displayed. Example In this example, we will issue the following command. find Sample.* This command will list all the files which start with the word ‘Sample’. whoami This command is used to display who is the current logged on user. Syntax whoami Parameters None Output The name of the current logged on user will be displayed. Example In this example, we will issue the following command. whoami Present Working Directory This command will display the current working directory. Syntax pwd Parameters None Output The current working directory will be displayed. Example In this example, we will issue the following command. Pwd Print Page Previous Next Advertisements ”;

Ubuntu – Server Installation

Ubuntu – Server Installation ”; Previous Next Ubuntu also comes in a server version. This version is used for hosting applications such as webbased applications. The server version can be downloaded from the Ubuntu site in the same way as the desktop version of Ubuntu. For the purpose of this tutorial, let’s look at the installation of the server version 14.04, which is one of the most popular versions of Ubuntu. Following are the steps for installation. Step 1 − Download for the server version from the link − http://releases.ubuntu.com/14.04/ Step 2 − Once the download of the server version is complete, put it on a USB device or bootable DVD. Boot the hardware from the bootable device. Step 3 − The system prompts to select a language for the Installation. Select English and press the Enter button. Step 4 − In the next step, choose the option to install Ubuntu server and press the Enter button. Step 5 − The system again prompts to select a language for the installation. Choose the English language and press the Enter button. Step 6 − In the next screen, select the desired region and then press the Enter button. Step 7 − The next step includes the detection of the Keyboard layout. Choose the ‘No’ option and press the Enter button. Step 8 − In the next screen, click the English(US) as the keyboard layout and press the Enter button. Step 9 − After performing a set of initial configuration steps, we will be prompted to enter a name for the system. Enter Ubuntuserver and press the Enter key. Step 10 − You will then be prompted to enter a real name and the username for an account to be created. Enter the name ‘demo’ and press Enter on both screens. Step 11 − Now we need to enter a password for the new account. Enter a password and press the Enter button. The system will ask to verify the password. Step 12 − The system then asks if we want to encrypt the home directory. For the moment, let us say ‘No’ and press Enter to proceed. The encryption is such that if anyone does hack into the system, they will not be able steal the data as it is encrypted. Once we are an advanced user of Ubuntu server, we can choose ‘Yes’ as the option. But for now let’s leave this as unencrypted. Step 13 − The Ubuntu server installation will then set the time settings. Choose ‘Yes’ and press the Enter button to proceed. Step 14 − Next the disk setup will take place. Choose the option ‘Guided – use entire disk and set up LVM’ and press the Enter button to proceed. Step 15 − The installation will erase all the data on the disk. Since this is a fresh installation, this is not an issue. Click the Enter button to proceed. Step 16 − We will be asked to confirm all the changes to the disk. Choose the ‘Yes’ option and Press the Enter button to proceed. Step 17 − The installation will detect the size of the hard disk. Hit the Enter button to proceed. Step 18 − The system then asks to finalize the changes to the disk. Choose the ‘Yes’ option and press the ‘Enter’ button to proceed. The system will then start performing a series of steps for the installation. Step 19 − It will then ask to configure the Proxy setting. We can leave this setting as is and press the Enter button. The installation will then start configuring the apt package manager. The installation of the necessary software will then start. Step 20 − The system then asks if we want to configure automatic updates. For now, select ‘No automatic updates’ and press the Enter button. Step 21 − The next step is to install any additional software. Select ‘OpenSSH’ server which allows one to remotely connect to the server. Press the Enter button to proceed. The system will start installing the remaining software on the system. Step 22 − The system now requests to install the GRUB boot loader. Choose the ‘Yes’ option and press the Enter button to proceed. Step 23 − Once the installation is complete, press the Continue option to proceed. The system will then reboot after the installation. Step 24 − We will then be requested to log into the system. Enter the credentials which were entered at the time of installation. We will finally be logged into the system. We have successfully installed the server version of Ubuntu. Print Page Previous Next Advertisements ”;

Ubuntu – Installing MySQL & Python

Ubuntu – Installing MySQL and Python ”; Previous Next MySQL and Python are famous database and development software respectively. These are normally installed on Linux-based systems. Let’s see how we can get them installed on Ubuntu server environments. Installing Python The first thing to do is to find out what is the version of Python installed on the system. We can find this issuing the following command. Python –v Where the –v option specifies to show what is the version of Python installed. The following screenshot shows a sample of the output of the above command. From the above output, we can see that the version of Python installed is version 2.7. There is another way to see if Python is installed via the following commands. Python –V Python3 –V The later command is used to see the version 3 of Python installed. If we want to have the latest version of Python installed, then we need to issue the following statement. sudo apt-get install python3 The above command will download the necessary packages for Python and have it installed. Installing MySQL To install MySQL, the following steps need to be followed. Step 1 − Issue the apt-get command to ensure all operating system packages are up to date. sudo apt-get update Step 2 − Once all the packages have been updated, it is time to get the packages for MySQL. sudo apt-get install mysql-server The above command will start the download of all the relevant packages for MySQL. Once the download completes and the installation starts, the installer will first ask to configure a root password. Step 3 − Enter the required password and click the OK button. It will also prompt to re-enter the password. Step 4 − To see the MySQL process running, run the following command. ps –ef | grep mysql The following screenshot shows mysqld which is the daemon process for mysql running in the background. Step 5 − To configure mysql, run the following command. /usr/bin/mysql_secure_installation It prompts to enter the root password which was entered during the installation process. Step 6 − Enter the password and hit Enter. Now, it prompts on whether we want to change the root password. Step 7 − Enter ‘N’ for No and proceed. Again, it prompts on whether we want to remove the Anonymous access. Step 8 − When connecting from other machines on this database, it is advised to keep the default options as ‘N’ for both anonymous users and disallow root login remotely. Step 9 − It is advised to provide the option as No for the options of Remove test database as well. We can enter ‘Y’ to reload the privileges table. Finally, the configuration of MySQL will be complete. Print Page Previous Next Advertisements ”;

Ubuntu – User Management

Ubuntu – User Management ”; Previous Next Ubuntu provides the facility to create new users who can be authorized to log on to the system. Let’s look at the different functions that can be performed with the help of user management. Creating Users The following steps need to be performed for the creation of users. Step 1 − Launch the user management console from the search menu. In the search menu, enter the keyword of users. The User Accounts icon will then appear. Double-click on the User Accounts icon. Step 2 − The user management screen will then pop up as shown in the following screenshot. To perform any sort of user management, we first need to press the Unlock button and enter our administrator credentials. Step 3 − Enter the administrator credentials in the pop-up box which comes up and click the Authenticate button. Once we click Authenticate, all the user management functions on the screen will become enabled. Step 4 − Click the plus button to create a user. Step 5 − Enter the user details. We can only create Standard and Administrator account types. Step 6 − Click the Add button to complete the operation of adding the user. Enabling the User Account When the user is created, the user account is disabled. This is because a password has not been associated with the account. Following are the steps to enable the user account. Step 1 − Click the Account disabled option. This will prompt for the password dialog box. We have the option to either set a password, log in without a password, or enable the account. A good practice is to always set a password for an account. Step 2 − To set the password and click the Change button. Step 3 − The account will now be enabled. Log in using the newly created account. Managing User Permissions and Groups To manage user permissions and groups, an additional package needs to be installed. Following are the steps to manage user permissions and groups. Step 1 − Go to the search option and type the command keyword. Step 2 − The search result of Terminal appears. Click it to open the command prompt. Step 3 − Next, issue the following command. sudo apt-get install gnome-system-tools The apt-get command line is used to install additional packages from the Internet for the Ubuntu system. Here, we are telling Ubuntu that we want to install additional system tools so that we can manage user permissions and groups. Step 4 − We will then be prompted for the password of the current logged in account and to also confirm to download the necessary packages for the installation. Enter the ‘Y’ option to proceed. Step 5 − Once the installation is complete, when we search for users in the search option in Ubuntu, we can see an additional option of Users and Groups. Step 6 − Click the Users and Groups option. Now, there will be an additional option of user and groups. Step 7 − Click the Advanced settings button. We will be prompted to enter the password of the current logged on user to authenticate. Enter the password and click the Authenticate button. Step 8 − In the next dialog box which appears, we will then be able to assign the required user privileges to the user. Step 9 − Now, if we click on the Groups option, we will see that it has the option to create and delete groups. Step 10 − Click on the Add button to add a group. Step 11 − In the next dialog box, we can provide a group name and assign members to that group. Step 12 − Finally, click the OK button to create the group. Print Page Previous Next Advertisements ”;

Ubuntu – Browsers

Ubuntu – Browsers ”; Previous Next The default browser for Ubuntu is Firefox and the latest version of Ubuntu always comes with the latest version of Firefox. On the desktop, you will see Firefox as the third component on the lefthand side. Double-click the icon to get started. Browsing Sites We can type the address of the site we wish to visit in the address bar and hit enter to get the site loaded. We will get the same user-like experience as in Windows. Installing Add-ons Step 1 − Additional add-ons can be installed by going to the options and choosing the Add-ons option. Using this option, we can view the add-ons installed and install new ones. We can search for an add-on and then click the Install button to install an add-on. Step 2 − For example, let us install the “Download flash and Video” add-on as shown in the above screenshot. Click the Install button at its side. Step 3 − Once done, the browser will prompt for restart. After restarting the browser, go to the Installed Add-ons section. It will show the “Flash and Video Download” add-on installed as seen in the following screenshot. Responsive Layout Here, we can see how the browser will adapt to various screen sizes. Step 1 − Click Options → Developer. Step 2 − Click Responsive Design View. Now, we can view the site in different browser sizes to see if they would respond as they should if they are viewed on different devices. Using Chromium The default application for Chrome usage on Ubuntu is called Chromium. Following are the steps to install Chromium − Step 1 − Go to the application manager for Ubuntu and go to the Internet section. Step 2 − In the following screen, click the Chromium web browser option. Step 3 − Next, click the Install button to install Chromium. Step 4 − Once the browser is installed, the chromium browser option will appear on the left-hand panel. Use it to launch Chromium. Print Page Previous Next Advertisements ”;

Ubuntu – Flavors

Ubuntu – Flavors ”; Previous Next Ubuntu comes in a variety of flavors. In this chapter, we will discuss briefly about some of the popular flavors of Ubuntu. Ubuntu Desktop This is the operating system which can be used by regular users. This comes pre-built with software that help the users perform usual basic activities. Operations such as browsing, email and multimedia are also available in this edition. The latest version as of September 2016 is 16.04.01. Ubuntu Server The server version is used for hosting applications such as web servers and databases. Each server version is supported by Ubuntu for 5 years. These operating systems have support for cloud platforms such as AWS and Azure. The latest version as of September 2016 is 16.04.1. Kubuntu The normal Ubuntu interface is based on a software called Unity. However, Kubuntu is based on a software called KDE Plasma desktop. This gives a different look and feel to the Ubuntu software. Kubuntu has the same features and software availability as Ubuntu. The official site for Kubuntu is https://www.kubuntu.org/ Linux Mint This is also based of the Ubuntu operating system. It comes pre-built with a lot of applications for the modern user in the space of photos and multimedia. This operating system is completely based on the open source community. The official site for Linux Mint is https://www.linuxmint.com/ Print Page Previous Next Advertisements ”;

Ubuntu – Word Writer

Ubuntu – Word Writer ”; Previous Next The Word Writer comes in-built in Ubuntu and is available in the Software launcher. The icon is encircled in red in the above screenshot. Once we click on the icon, the writer will launch. We can start typing in the Writer as we normally would do in Microsoft Word. Saving Documents To save a document, just click on the save menu option as shown in the following screenshot. Specify the location, the name of the file and then click the Save button. Creating New Documents To create a new document, choose the new menu option as shown in the following screenshot. It shows an option to create various types of documents. Opening an Existing Document To open an existing document, choose the option of opening an existing document from the file menu options as shown in the following screenshot. The option icon is encircled in red. Once the open menu option is clicked, it presents a dialog box with an option to choose the file which needs to be opened. Click on the desired file and then click Open. Working with Tables Tables can be inserted using the Insert table option as shown in the following screenshot. Once the table has been added, we can then work on the table as we would on Microsoft Word. To add additional rows and columns work to the table, right-click on the table and choose the various table options available. You can also work with the format of the text using the various font options in the toolbar of Word Writer. Print Page Previous Next Advertisements ”;

Ubuntu – Software Center

Ubuntu – Software Center ”; Previous Next Ubuntu has a Software Center using which you can install a host of applications. The Software Center is designed to search the Internet for available software which can be downloaded and installed. Installing Software Step 1 − In the control panel, the Software Center appears on the left-hand side of the screen. In the following screenshot, it is encircled in a red box. Double-click to open it. Once open, it shows the following options − View all the available software. All software currently installed on the machine. Any updates available for the software currently installed on the machine. Step 2 − We can also browse through various software categories. For example, let’s click the Audio category. We can see a list of available software for installation. As seen in the following screenshot, the application ‘Rhythmbox’ has already been installed. Step 3 − Now let us choose an application, say the Music application and see how it installs. Step 4 − Once we click the Music application, the following screenshot pops up. Click the Install button to begin the installation. We will then see the Installing progress bar to show that the Music application is being installed. Step 5 − Once the installation is complete, click the Launch button to launch the software. Removing Software To see the list of already installed software on the machine, go to the Installed section of the Software Center application. This presents an option to remove the unwanted software if required, as shown in the following screenshot. To remove any unwanted software, click the Remove button associated with the required software. Updates In the updates section, we can install critical updates available for the Ubuntu operating system. This section also shows the updates available for the software already installed on the system. Click the Install button next to the desired update that needs to be installed. Print Page Previous Next Advertisements ”;

Ubuntu – Nginx

Ubuntu – Nginx ”; Previous Next Nginx is a much lighter web server than Apache. This web server has become quite popular in the recent years. The Apache web server can be quite complex to configure and use. However, Nginx is much simpler. This chapter will focus on how to install this light web server. To install Nginx, following are the steps − Step 1 − Open the command terminal on Ubuntu desktop and run the following command. sudo apt-get update This first ensures that all packages on the operating system are up to date. Step 2 − Next enter the following command to install the nginx server. sudo apt-get install nginx Step 3 − Once done, if we run ps –ef | grep nginx, we can see the process for the web server in a running state. We now have nginx run as a web server on Ubuntu. Print Page Previous Next Advertisements ”;

Ubuntu – Virtual Machines

Ubuntu – Virtual Machines ”; Previous Next Ubuntu can also be installed as virtual machines. Some of the software which support virtual machines are − Microsoft Hyper-V VMWare Workstation Oracle VirtualBox Let’s use Oracle VirtualBox to create our Ubuntu virtual machine. Oracle VirtualBox is a free tool from Oracle. Following are the steps to have the virtual machine in place. Step 1 − Download Oracle VirtualBox from the oracle site − https://www.virtualbox.org/ Step 2 − Go to the downloads section and download the Windows version. Step 3 − Once download is complete, install VirtualBox. Launch the installer. Click the Run button on the following screen. Step 4 − Click the Next button on the subsequent screen. Step 5 − Choose the appropriate folder location and click the Next button. Step 6 − Click Next on the subsequent screen. Step 7 − Click the ‘Yes’ button on the next screen to proceed ahead with the installation. Step 8 − Click Install on the next screen. Step 9 − After the installation is complete, launch Oracle VirtualBox. On the Launch screen, click the ‘New’ menu option. Step 10 − Give a name for the virtual machine and give the type as Ubuntu and then click the Next button. Step 11 − In the next screen, keep the recommended RAM as it is and click the Next button. Step 12 − Accept the default setting for the virtual hard disk and click the Create button. Step 13 − Accept the hard disk type and click the Next button. Step 14 − Accept the default type of physical hard disk allocation and click the Next button. Step 15 − Accept the default file location and click the Create button. Step 16 − Now that the Virtual Machine has been created, click the Settings Menu option. Step 17 − Go to the Storage option, click the Empty disk icon and browse for the Ubuntu iso image. Then click the OK button. Finally click the Start button. The system prompts to install Ubuntu. Follow the steps in the Installation chapter and we will have a Virtual Machine hosting Ubuntu. Print Page Previous Next Advertisements ”;