How to search file in Ubuntu

Searching file using search box can be tedious or utterly slow, you can search any file on your hard-drive using following command.

I had to seach image named “IMG_7961.JPG" I used following command on terminal

$ tree -f  / | grep IMG_7961
│   │   │   │   ├── /media/conquistador/Data/recovered data/IMG_7961.JPG
│   │   │   │   │   ├── /media/conquistador/Data1/20181028 Ghorwadeshwar/converted/IMG_7961.jpg
│   │   │   │   │   ├── /media/conquistador/Data1/20181028 Ghorwadeshwar/converted/IMG_7961.jpg.out.pp3
│   │   │   │   ├── /media/conquistador/Data1/20181028 Ghorwadeshwar/IMG_7961.JPG
│   │   │   │   ├── /media/conquistador/Data1/20181028 Ghorwadeshwar/IMG_7961.JPG.pp3
│   │       │   │   ├── /media/conquistador/PRAVINDSLR/DCIM/100CANON/IMG_7961.CR2
│   │       │   │   ├── /media/conquistador/PRAVINDSLR/DCIM/100CANON/IMG_7961.JPG

Resources for Learning Statistics

Various online resources (online sources, text books) are freely available on internet.

There are so many online courses that you might get overwhelmed bu the sheer numbers.

 

How to get post tags and categories

Many times you might need to display post tags or categories along with the post. This can be achieved by using following code


<?php
echo get_the_tag_list('<p>Tags: ',', ','</p>');
?>

If you are using custom taxonomy, you can use following code


<?php echo get_the_term_list( $post->ID, 'modernquotetaxonomy', 'Tags: ', ', ' ); ?>

Using WP Query for Custom Posts

WP Query can be used to fetch posts as per your requirement. Simple syntax for WP_Query is as below

WP_Query for Custom Posts

  <?php  $args = array(
    'post_type' => 'modernquote',
    'tag' => 'success',       
     'orderby' => 'post_date',
     'order'   => 'ASC');
   
  // Custom query.
  $query = new WP_Query( $args );
   
  // Check that we have query results.
  if ( $query->have_posts() ) {
   
      // Start looping over the query results.
      echo "<ul class='list-group '>";
      while ( $query->have_posts() ) {
          $query->the_post();
      // echo '<a href="' .get_post_permalink() .'"><li class="list-group-item">'. get_the_title() . '</li></a><br>';
      echo '<a href="' .get_post_permalink() .'" class="list-group-item">'. get_the_title() . '</a>';
      }
      echo "</ul>"; 
  }
  // Restore original post data.
  wp_reset_postdata();
  
  ?> 

WP_Query for Custom Posts with conditions

  <?php  $args = array(
    'post_type' => 'modernquote',
    'tax_query' => array(
        array (
            'taxonomy' => 'modernquotetaxonomy',
            // 'field' => 'slug',
            'terms' => 'love hindi',
        )
    ),      
     'orderby' => 'post_date',
     'order'   => 'ASC');
   
  // Custom query.
  $query = new WP_Query( $args );
   
  // Check that we have query results.
  if ( $query->have_posts() ) {
   
      // Start looping over the query results.
      echo "<ul class='list-group '>";
      while ( $query->have_posts() ) {
          $query->the_post();
      // echo '<a href="' .get_post_permalink() .'"><li class="list-group-item">'. get_the_title() . '</li></a><br>';
      echo '<a href="' .get_post_permalink() .'" class="list-group-item">'. get_the_title() . '</a>';
      }
      echo "</ul>"; 
  }
  // Restore original post data.
  wp_reset_postdata();
  
  ?> 

How to Install Google Fonts on Ubuntu

Google Fonts large collection and different types of fonts. These can be used not just for your websites but also on your desktop/Laptop as well.

And yes, google officially allows downloading and install google fonts on your computer. Please follow along.

Step#1 Download required google fonts

Go to Google fonts home page and click on + sign of the font that you would like to download.

 

Once you select require font, it will get added to selected font window(just like shopping cart). Click on the window header to open it fully. In this article we will try to install font called as “Lora”. Selection window will open something like below.

Click on download sign on right hand upper corner to download the files. It will download a zip file “Lora.zip”

Step#2 :Unzip and Install the Google Font

Now extract the zip file. Once you double click on the TTF (TrueType Fonts) or OTF (Open Type Fonts) file, it will open with Font Viewer. Click on install at right hand upper corner.

Note: Downloaded and unzipped folder will contain Lora-Bold.ttf, Lora-BoldItalic.ttf, Lora-Italic.ttf and Lora-Regular.ttf. You need to install all files individually.

You installation is complete, “install” buttom at top right will get changed to “Installed”

Now open and application like Libre Office or GIMP and you will be able to access the installed fonts

Another way to install the fonts ?

The fonts that you have installed are kept at following location

~/.local/share/fonts

If you want to install a font using command prompt or want to install multiple fonts, simple move fonts files to this folder (either manually from GUI or from terminal) and it will be accessible in your application.