Cloud Hosting

Cloud Hosting for Small Business: What are the Benefits?

Adnan Raja April 6, 2016 by under Cloud Hosting 0 Comments

In this spinoff of our previous article about general benefits of a cloud server over an on-premises one, we look at the specific key advantages of cloud computing for small business. Then we explore a six-step SMB cloud transition checklist.

  • 7 Benefits of Cloud for Small Business
  • 5-Step SMB Cloud Transition Checklist

7 Benefits of Cloud for Small Business

Generally speaking, cloud computing is a positive choice for business. It’s an especially easy and sensible direction when we are talking about SMBs and startups.

For one thing, the typical issues enterprises might raise related to cloud – particularly integration and security – are minimized at a small business because the systems are less complex and because growth is prioritized over concerns with third-party data protection. Cloud Server Hosting services actually tend to be a major improvement in security over in-house systems, but that’s more obvious in the context of SMBs.

Read More


Advantages of Having a Cloud Server Rather Than Buying Your Own

Sam Guiliano March 25, 2016 by under Cloud Hosting 0 Comments

Increasingly, business is moving from the physical servers of onsite data centers to the virtual servers of the public cloud.

  • Away from On-Premises
  • The Need for Change in Business
  • 11 Advantages of Cloud Servers
  • Switching Your Business to a Cloud Server

Away from On-Premises

The era of companies having their own data centers is quickly drawing to a close. As business increasingly finds its technological home in the cloud, IT departments are having to rapidly adjust. In fact, nearly 2 in 5 small businesses (37%) have completely transitioned to the cloud. There is a lot of growth ahead, though. According to a 2014 report from Intuit, 80% of businesses will be cloud-based by 2020.

There has been a recent trend in which businesses are shifting from capital expenses (CAPEX), the realm of an on-premises datacenter, to operating expenses (OPEX), the realm of public cloud computing. OPEX is the route that more and more companies choose – especially since month-to-month and even moment-to-moment agility has become so valuable to business. Plus, cloud allows you to cut your power usage by optimizing your server efficiency.

Read More


What Linux Distro Should You Use? The Best Linux Distributions

Sam Guiliano March 18, 2016 by under Cloud Hosting 0 Comments

What are the best Linux distributions? Let’s look at four distros that we feel are the best available for general needs – secure, stable, and reliable.

  • About Linux
  • Best Linux Server Distros for You
  • Flavor #1 – Ubuntu
  • Flavor #2 – CentOS
  • Flavor #3 – Debian
  • Flavor #4 – Fedora
  • Deploying Your Linux Server

About Linux

As an operating system (OS), Linux is software that allows programs and the user to access the computer’s hardware and perform tasks. The OS sends directions from a program to the central processing unit (CPU), for example. Once the assigned work is completed, the CPU gets the data to the OS for transfer back to the program. The OS is like a mediator.

Read More


The Benefits of Cloud Based Applications: Should I Put My App in the Cloud?

Adnan Raja March 17, 2016 by under Cloud Hosting 0 Comments

More and more companies are migrating their apps to cloud infrastructure-as-a-service providers. Here’s why.

  • Cloud as the New Standard
  • 3 Reasons You’ll Choose Cloud
  • 5 Ways Cloud Saves Money
  • SSD Cloud Hosting

Cloud as the New Standard

According to the 2016 State of the Cloud report, more than nine in ten companies (93%) are using some type of infrastructure-as-a-service – basically, a cloud server hosting provider for at least one of their applications. The vast majority of large companies (82%) use a hybrid cloud, integrating public and private components.

Public cloud is incredibly popular among organizations of all sizes. Seven out of every eight firms (88%) run apps on a public cloud, while well over half (63%) run systems on a private cloud.

These statistics are obviously compelling on their own, but why is this trend toward cloud occurring? Let’s look at three basic reasons and five financial reasons.

Read More


There’s Nothing to Fear in Migrating to the Cloud

Adnan Raja March 15, 2016 by under Cloud Hosting 0 Comments

More and more businesses are adopting cloud infrastructure and services. However, some people still feel a little nervous about the idea of entrusting their data to an outside entity. Let’s look at why companies are taking this route, along with one executive’s argument that cloud is no longer optional but necessary.

  • 87% Either Using or Open to Cloud
  • Why Businesses are Choosing Cloud
  • Why Cloud is a Secure Necessity for SMBs
  • Secure IaaS Cloud Hosting

87% Either Using or Open to Cloud

Cloud is now a day-to-day part of the modern world. Massive, widely used systems such as iTunes, along with websites and databases of all sorts, use the cloud to allow for reliable real-time delivery, with account accessibility from any device.

Although the cloud has become a part of our lives as consumers, many business leaders still remain skeptical about whether it’s the right choice for their organization. That’s clear from the 2015 Pulse Survey by The Alternative Board (TAB), which found that one-third of business owners have not implemented any cloud solutions for their firms. A smaller percentage, 13%, said that they would not explore the technology for use in the future.

Read More


How to Install Java (JRE or JDK) on Ubuntu 16.04

Atlantic.Net NOC March 4, 2016 by under Cloud Hosting 0 Comments
Java Illustration by Walker Cahall

Java Illustration by Walker Cahall

Verified and Tested 03/4/16

Introduction

If you had the option to choose between a base model car or a fully loaded model, which one would you choose?

Both cars will take you from point A to point B, but with the fully loaded car you have additional features that can make rush hour a chill hour.

Well, that’s the same concept when we take a closer look at Java. There are two standard types of installations, JRE (Java Runtime Environment) and JDK (Java Development Kit). Like the base model car, JRE enables the ability to create Java Applications for different types of deployments using minimal core tools to accomplish the task. JDK is a fully loaded Development Kit that has everything that JRE has plus additional resources to create/secure Applications and Applets.

Read More


What is DROWN: A Vulnerability That Can Imperil Your Encrypted Traffic

Mason Moody March 3, 2016 by under Cloud Hosting 0 Comments

On 1 March 2016, security researchers announced a new vulnerability exploit involving an old security protocol, SSLv2, that affects up to 33% of web servers. Even web servers that do not allow SSLv2 connections might be vulnerable if the RSA private key used on the server is reused on other servers. And, as seems to be de rigueur for major vulnerabilities nowadays, it comes with a simple and foreboding name: DROWN (which is admittedly much easier to remember and reference than its official designation of CVE-2016-0800).
.

How DROWN Works

DROWN imageDROWN (Decrypting RSA using Obsolete and Weakened eNcryption) requires an attacker only have access or ability to sniff network traffic and the ability to query a vulnerable server.

An example scenario would involve an attacker in a Man in the Middle (MitM) position and able to see a client initiate a TLS connection to a web server to establish a secure HTTPS session. The attacker copies this encrypted session, including the encryption negotiation that starts it. The attacker then takes the initial key negotiation and runs a variant of an old attack on SSLv2 connections known as the Bleichenbacher attack (or, the million message attack) on another server that is willing to use SSLv2 and which uses the same RSA private key as the original server. Because of the way that SSLv2 handles session key generation, this attack could allow an attacker to exploit the weaknesses of SSLv2 (which has been considered obsolete and insecure for almost 20 years now) to gain the keys negotiated over the more secure TLS connection.

The researchers were able to “decrypt a TLS 1.2 handshake using 2048-bit RSA in under 8 hours using Amazon EC2, at a cost of $440.” By exploiting a recently patched (in March 2015) vulnerability in OpenSSL, they duplicated similar results “in one minute on a single CPU”.
.

Am I Affected?

The researchers who discovered this exploitation have an online tool that can let you know if your domain or IP is vulnerable. This tool presents positive results culled from scans they performed over February 2016, so it doesn’t represent real-time data. If you’ve recently updated your OpenSSL version or recently made changes that could address vulnerability to DROWN, you could use the scanner utility they have put together to help you verify your exposure.
.

Mitigating Exposure to DROWN

Since SSLv2 is the primary vector for this attack, removing that protocol as an option during any secure connection negotiation is the first step. Consult with the documentation for your applications that use SSL/TLS for the specific configuration settings that disable SSLv2 (and SSLv3, for that matter). Affected applications can include web servers (Apache, Nginx, etc.), mail servers (Postfix, e.g.), and any connection-oriented services, especially anything using the OpenSSL library.

In addition, OpenSSL users should upgrade their OpenSSL to version 1.0.2g or 1.0.1s, depending on whether you are using version 1.0.2 or 1.0.1, respectively. Some earlier versions of OpenSSL may still allow for exploitation of this attack via the use of weak export ciphers even if they are explicitly disabled, so where possible, upgrade is your best option–these versions also contain patches that address other vulnerabilities unrelated to DROWN.

Finally, a more reliable fix would be to use a unique private key on each server that needs to run TLS. With certain certificates, particularly OV and EV certificates, this option does incur additional cost and may be viable to all deployments or situations.
.
.


How to Install Nginx, MySQL, PHP (LEMP) stack on Ubuntu 16.04

Brendan Bonner March 3, 2016 by under Cloud Hosting 0 Comments
NGINX Car by Walker Cahall

NGINX Car by Walker Cahall

Verified and Tested 03/3/15

Introduction

This how-to will show you how to install LEMP on a Ubuntu 16.04 cloud server. LEMP is a web service stack that consists of a Linux operating system, Nginx (pronounced “engine-x”), MySQL, and PHP. The main difference between LAMP and LEMP is that LAMP uses Apache, and LEMP uses Nginx. LEMP has been gaining popularity in the last few years because it excels in speed and scalability.

Prerequisites

A server with Ubuntu 16.04 installed.  If you do not have a server, consider SSD Cloud Hosting from Atlatnic.Net.

Installing LEMP on a Ubuntu 16.04  Cloud Server

First we want to make sure that your server is up to date by running the commands:

sudo apt update
sudo apt upgrade

Note: Depending on your installation you may need to remove apache2. You can do that by running the commands:

sudo apt remove apache2*

Followed by:

sudo apt autoremove

 

Installing Nginx on Ubuntu 16.04

To install Nginx, use the command:

sudo apt install nginx

When it asks “Do you want to continue?”, hit Enter.

Start the Nginx service with the following command:

sudo service nginx start

We can now test Nginx by going to your hostname or IP address in your browser’s address bar. If you do not know your server’s IP address, you can run the following command:

ifconfig

You should get a result similar to the image below.

An example of ifconfig showing the IP address 172.20.6.154

An example of ifconfig showing the IP address 172.20.6.154

In our example, 192.168.0.192 is the IP address. So in our browser we would go to http://192.168.0.192.

You should see a web page that looks like the image below.

This example is the default nginx web page on Ubuntu 16.04

This example is the default nginx web page on Ubuntu 16.04

Now that Nginx is installed, we can move on to installing MySQL.

Installing MySQL on Ubuntu 16.04

Install MySQL with the command:

sudo apt install mysql-server

When it asks “Do you want to continue?”, hit Enter.

Shortly after, a screen similar to the image below will appear.  You need enter a password for your MySQL root user. It should be a strong password.

Insert your secure password for your new MySQL root password

Insert your secure password for your new MySQL root password

Hit enter to continue. Once you have hit enter, a new screen will appear prompting you to re-enter the password you just picked.

Retype your MySQL password

Retype your MySQL password

Now that MySQL is installed we need to do the MySQL secure installation by running the command:

sudo mysql_secure_installation

Enter your MySQL root password. When it asks “Change the root password?”, type “N” followed by Enter. The rest of the questions are up to you. For standard installations, you can hit Enter for the defaults. It will look similar to the code box below.

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] n
 ... skipping.

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n]
 - Dropping test database...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
 ... Failed!  Not critical, keep moving...
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]
 ... Success!




All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

 

Now that MySQL is installed, we can now install PHP.

Installing PHP on Ubuntu 16.04

Install PHP with the following command:

sudo apt install php php-fpm php7.0-mysql

When it asks “Do you want to continue?”, hit Enter.

For Nginx to work with PHP correctly, we need to edit an Nginx configuration file. In this how-to, we are going to use a simple Nginx config file.

First, we need to move the original configuration file to a new file name. Run the command:

sudo mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default.old

Using a text editor of your choice, we are going to make a file called default in /etc/nginx/sites-available. For nano use the command:

sudo nano /etc/nginx/sites-available/default

Copy the following into your text editor:

server {
        listen       80;
        server_name  your_site_name.com;
        root /usr/share/nginx/html;
        index index.php index.html;

        location / {
                try_files $uri $uri/ =404;
        }

        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;

        location = /50x.html {
                root /var/www/html;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

In nano, to exit and save, hit Ctrl+x , type “y”, and then Enter.

Since we made changes to the configuration file, we need to restart Nginx, by running the command:

sudo service nginx restart

We are now going to make a simple PHP page to test.

Using a text editor of your choice, we are going create a file called info.php in /usr/share/nginx/html/.

sudo nano /usr/share/nginx/html/info.php

Copy the following into your text editor.

<?php
phpinfo();
?>

In your browser, you can go to http://Your-Hostname/info.php or http://Your-IP-Address/info.php. As above, in this example, we would use http://192.168.0.192/info.php.

You should see a web page similar to the one below.

An example of the info.php web page

An example of the info.php web page

Once you are done testing, it is a good idea to remove the info.php file, since it may give a potential attacker information that can be used to craft a specific attack against your server. To do that run the command:

sudo rm /usr/share/nginx/html/info.php

Congratulations, you have installed LEMP on Ubuntu 16.04. Thank you for following this how-to. Please check back for more updates, or take a look at our how-to on Installing WordPress on Ubuntu 16.04!


Docker Net Worth: Why Docker Was Valued at $1 Billion Last Year

Sam Guiliano February 26, 2016 by under Cloud Hosting 0 Comments

In April 2015, Docker was valued at $1 billion. Why is that? Of course, Docker is not just a trend. What’s so remarkable about this containerization technology? Why is the company worth so much?

  • Growth of the Company
  • Value of the Company
  • 5 Reasons Docker is Worth $1 Billion
  • One-Click Docker

Growth of the Company

Docker adoption has been growing rapidly. In fact, a study of 7000 businesses found that adoption of Docker rose 400% between September 2014 and November 2015.

The study, from infrastructure monitoring group Datadog, showed that Docker had almost none of the market in fall 2014 but was running on 6% of the servers tracked for the report by November. Interestingly enough, this open source software is particularly popular among enterprises: over half of firms with more than 500 hosts have used Docker, at least in testing environments.

Read More


How to Use the Linux Find and Locate Commands on a Linux Cloud Server

Jason Mazzota February 22, 2016 by under Cloud Hosting 0 Comments
Verified and Tested 2/22/16

Introduction

The Linux find command allows you to find files or directories using fields such as age, group, name, last modified, size, type, and many others. This is very useful when you’re working on a Linux system which you are not familiar with. We will go over the basic and most commonly used flags you’ll run into in our Find section.

The Linux locate command comes paired with its partner updatedb. The locate command allows you to locate files that contain your searching criteria and displays them out for you. The updatedb partner it has is what keeps the locate command up to date on the files in your system. It can essentially be seen as a directory list and your locate command helps you sort through for locations/files that have what your searching for in the path or name.

Prerequisites

A Linux server with find and locate installed. Try our Linux Cloud Hosting if you don’t have one. The find command typically comes installed on Linux operating systems by default. If it does not, you can use your operating system’s package manager(yum, apt-get, pkg_add) to install it. Depending on your operating system, locate may be installed as well. If it is not, you can install it via your operating system’s package manager and installing its containing package. This package is typically called “mlocate.”

 

Let’s Find something!

If at any time you are confused by find and it’s command or you wish to know even more about it, you can bring up its manual with the below command. The manual contains all information regarding using the find command in great detail.

# man find

When using find, you would follow the syntax below.

find [options] [path] [expression]

options: This is optional. You can leave this out most of the time. You can read the manual page for all the options the find command has.

path: This is the directory you want to search.

expression: This is where you place your search criteria for what you want to find whether by name, or size etc.

 

With the below we will be going over multiple ways on using find.

Let’s find any files named index.html without knowing the directories the files may be in.

#find / -name 'index.html'

/usr/libexec/webmin/time/help/index.html
/usr/libexec/webmin/fdisk/help/index.html
/usr/libexec/webmin/inittab/help/index.html
/usr/libexec/webmin/dfsadmin/help/index.html
/usr/share/gtk-doc/html/liboil/index.html
/usr/share/gtk-doc/html/schroedinger/index.html
/usr/share/gtk-doc/html/pango/index.html
/usr/share/gtk-doc/html/cairo/index.html
/usr/share/gtk-doc/html/libxml2/index.html
/usr/share/gtk-doc/html/atk/index.html

/ : This is the “/” directory which causes you to search the entire “slash” directory.

-name : This is the flag telling “find” to search for a pattern, in this case, the name pattern which compares the names of files with your expression.

‘index.html’ : This is the expression you’re searching for.

 

Now we’ll find a file call index.html in a specified directory.

#find /var/www/html -name 'index.html'

/var/www/html/index.html

This will cause find to search only the /var/www/html directory for any files named ‘index.html’.

 

In this example, we’ll have “find” find a file call index.html in a specific directory ignoring the casing of the name.

#find /var/www/html -iname 'index.html'

/var/www/html/INDEX.html
/var/www/html/index.html

-iname : This is the flag telling “find” to search for an expression, while ignoring the case of the text.

 

Now we’ll search and “find” a directory’s name while ignoring the case of the directory.

#find / -type d -iname 'www'

/usr/share/perl5/WWW
/var/www
/opt/ss/var/www

-type d : This tells find to look only for directories, not files. If you change the “d” to “f” you will get the opposite and find files instead.

 

And now we’ll find every file on the system that ends in .php.

# find / -type f -iname "*.php"

/var/www/html/zm/views/file.php
/usr/share/wordpress/wp-admin/ms-themes.php
/usr/share/php/getid3/module.archive.szip.php
/usr/share/doc/php-PHPMailer-5.2.2/examples/test_smtp_advanced_no_auth.php

*.php : The * in the expression stands for a wildcard. A wildcard will grab any file it finds as long as it ends with what follows it. In this case it is “.php”

 

We will continue with an example of finding a file ending with .cgi that has 755 permissions and we’ll ignore the case.

# find / -type f -iname "*.cgi" -perm 755

/usr/libexec/webmin/bacula-backup/backup_form.cgi
/usr/libexec/webmin/bacula-backup/label_form.cgi
/usr/libexec/webmin/bacula-backup/save_file.cgi
/usr/libexec/webmin/bacula-backup/index.cgi
/usr/libexec/webmin/bacula-backup/edit_pool.cgi
/usr/libexec/webmin/bacula-backup/gbackup.cgi
/usr/libexec/webmin/bacula-backup/edit_job.cgi

-perm 755 : The flag ‘-perm’ searches permissions in the directory specified. In our case it searches for files with ‘755’ permissions.

 

Now we’ll get time specific. We’ll search for files which have been modified between now and 10 days ago.

# find / -type f -mtime -10

(we don't have any)

-mtime -10 : Find any file that’s been modified between now and 10 days ago in the specified directory. As you can see the from 10 days ago til now is signified by the “-” in front of the 10. If you wanted to find anything older than 10 days, you can change the “-” to a “+”. This will have the search only list files that were changed 10 days ago and onward. If you wanted to find a file changed in the last 24 hours, you can actually use “-mtime 0” as it has not been a full 24 hours.

 

We can find files by size.

# find / -type f -size +50M -size -100M

/usr/sbin/mysqld-debug
/usr/sbin/mysqld
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.31-1.b13.el6_6.x86_64/jre/lib/rt.jar
/usr/lib/locale/locale-archive
/var/log/messages
/var/lib/rpm/Packages

-size +50M -size -100M : With “-size” you tell find to search by size. In our case +50M which would be files more than 50 megabytes in size. We limit the search with a -100M which means the maximum file size can only be 100 megabytes. You can specify other file sizes such as bytes(c), kilobytes(k), and gigabytes(G). Case does count in this situation as not using the correct notation can lead you searching for the wrong information.

 

And finally, find can not only be used to search for files or directories, but you can also execute and run commands for each item found. Please note that executing a command while using find can lead to dangerous results if you do not know exactly what you are doing.

 

# find / -type f -size +50M -size -100M -exec du -lsh {} \;

70M     /usr/sbin/mysqld-debug
84M     /usr/sbin/mysqld
62M     /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.31-1.b13.el6_6.x86_64/jre/lib/rt.jar
95M     /usr/lib/locale/locale-archive
65M     /var/log/messages
54M     /var/lib/rpm/Packages

-exec : This flag tells find that for each item found, run the following command

du -lsh : This command prints in a more readily human readable format that size of a file.

{} : This serves as a placeholder. Each time an item is found, the item is placed in place of these brackets and executes the command preceding these brackets. So in the example find will execute a “du -lsh” on it item found.

\; : This finishes the “-exec” statement. You must end every find command containing “-exec” with a ‘\;’ or it will fail.

 

And that’s the basics of using the Linux command “find”. There are many more flags to explore such as “printf” for output formatting, “max/min depth” which limit how deep find will dive into a directory, and “newer” which compares if a file was modified more recently than another file. Keep using find and soon you’ll be able to “find” anything.

 

Let’s Locate some files!

Locate in a few ways is like “find” discussed above in that it is another method of searching your operating system to find a file. One of the key differences with locate is that it will discern between a directory or file. It will always look for both. Locate comes paired with it’s partner command “updatedb” which, as it looks like, updates the DB or database of files it has that locate can parse through. Locate will not provide you with full, accurate results unless you run it’s partner, “updatedb” first.

When using locate, you’d want to follow the syntax below.

locate [OPTION] PATTERN

[OPTION] : Would be any and all options that locate can use. For a full list of the options, you can see the manual page (#man locate).

PATTERN : This is what you would be searching for.

 

So getting started, lets first run updatedb.

#updatedb

Updatedb will not give any output but will simply drop the shell to the next line once it has completed. Now lets try to locate any .repo file.

# locate *.repo

/etc/yum.repos.d/CentOS-Base.repo
/etc/yum.repos.d/CentOS-Debuginfo.repo
/etc/yum.repos.d/CentOS-Media.repo
/etc/yum.repos.d/CentOS-Vault.repo
/etc/yum.repos.d/CentOS-fasttrack.repo

*.repo : This again is a wildcard search which allows us to find any and all files that end in .repo

 

You can use locate to find directories as well. In this case, we only want to look for the www directory, so we restrain the search to looking only for “www”.

# locate -b www

/usr/share/groff/1.18.1.4/tmac/www.tmac
/usr/share/man/man7/groff_www.7.gz
/var/www

-b : This option tells locate only to pull files/directories that contain or end with www and nothing else. The opposite of this is -w which is what locate does by default and will find absolutely anything with your pattern in it.

 

We can also tell locate to search for a file or directory and ignore any casing.

# locate -bi noindex.html

/var/www/error/NOINDEX.html
/var/www/error/noindex.html

-bi : The -b option is explained above but this time we tacked on -i as well. -i is what allows you to ignore casing in your search.

 

Now lets say you want to limit your locate results to only a few. We’ll use the *.repo search early and search for only three results.

# locate -il 3 *.repo

/etc/yum.repos.d/CentOS-Base.repo
/etc/yum.repos.d/CentOS-Debuginfo.repo
/etc/yum.repos.d/CentOS-Media.repo

-il 3 : The new tack on this time is -l #. -l tells locate to limit the search to the number of results you put after it. If you use -l, remember to always use it last on your options list if you are combining options or to separate it (in this case -i -l 3) otherwise you will get an error.

 

Unfortunately locate does not have a built-in ability to execute commands per result found like find does. But like “find” and most any commands in Linux, you can pipe the results to narrow out your results. “find” allows you to do a lot of limiting with the options it provides but locate doesn’t have that innate ability. So to limit our results we’ll “pipe” them to “grep” which is a command that prints lines only for the results containing the pattern given to it.

# locate -i index.html | grep www

/var/www/error/NOINDEX.html
/var/www/error/noindex.html

| : This is the pipe command

grep www : This limits out the results to only list the results that have a www in them whether in the name or part of the directory.

And those are the basics of the locate command. While it doesn’t have the flexibility that the find command may have, it is another searching tool and doesn’t require you to know much about Linux to use it. There are options to provide more results like -L which will follow symbolic links, -e which only lists files that exist at the time locate is run, and -c which provides a count for how many results are found, and more. The very best thing to remember about using locate is to always make sure that you do an updated before running locate to get accurate, up-to-date results.


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

Resources

We use cookies for advertising, social media and analytics purposes. Read about how we use cookies in our updated Privacy Policy. If you continue to use this site, you consent to our use of cookies and our Privacy Policy.