Matt Jones Tech
  • Blog
  • Video Projects
  • Web Projects
  • Locate Files using Terminal

    Let’s locate files using the terminal! This is just a cool little trick you can use if you’re doing a bunch of stuff in the terminal, and you don’t want to leave, or you’re just interested in cool terminal tricks. Let’s say you’re looking for a file, anywhere on your machine, but you don’t know exactly where it is. You can install a very cool search package called mlocate (or merging locate).

    Install

    On Ubuntu/Debian you can run:

    sudo apt-get install mlocate

    Or if you’re on that Manjaro/Arch life:

    sudo pacman -S mlocate

    Syntax

    To locate files in the terminal by using mlocate, just type:

    locate [name of the file] [directory in which you want to start recursively searching]

    If you’re using mlocate for the first time, it’s not gonna work just yet. mlocate is actually a pair of tool bundled into one. The other half of mlocate is called updatedb. So by running updatedb, you’re essentially creating/updating an index so that you can run your search. So any time you want to run a locate command and it’s not giving you the results you are expecting, there’s a good chance your index is outdated, so you can just run updatedb, then run your locate search again, and you should be good to go.

    Update your junk by running updatedb then run locate [file] to get your mind blown!

    Bonus Tip

    If the results of your locate command are crazy long, like… CRAZY long…. too long to view everything in the terminal because your terminal only has a finite history, here’s a tip: You can print the results of ANY command to a text file and save it anywhere by using >. For example:

    sudo locate myfile.txt / > ~/Desktop/searchresults.txt

    The above command will run a system-wide search for anything matching myfile.txt recursively from the root directory / and print the results to searchresults.txt on the Desktop.

    Good luck and have fun! Now that you’ve found the file you’re looking for, perhaps you want to do something cool with it! If you wanna learn more cool stuff you can do in the terminal, check this out.

    matt

    September 23, 2019
    General Computing, Linux, Ubuntu
    arch, command line, debian, linux, manjaro, search, terminal, ubuntu
  • How To Set Up a Raspberry Pi 3 B+

    Prerequisites

    For this tutorial, I’m going to assume that you’ve got enough hardware to get started. And if you got your Raspberry Pi as part of a kit, then you should be good to go. You should have the following:

    • Raspberry Pi board
    • Raspberry Pi power supply (micro USB Output 5V DC 2.5A Regulated, Input 100V to 240V AC)
    • Raspberry Pi case (not technically required, but I definitely want to protect my pi!)
    • Micro SD card (at least a class 10)
    • HDMI cable (full size, male to male)
    • Monitor or television capable of displaying output from a full HDMI port
    • USB-A mouse
    • USB-A keyboard
    • A computer
    • A micro SD card reader

    Download your OS

    You can run tons of different operating systems on your Raspberry Pi, but for this demo, we’ll go with the OS officially supported by the Raspberry Pi Foundation called Raspian (based on Linux Debian). You can download the operating system here. Once you have the operating system downloaded, you’ll want to head over and download the latest version of Etcher.

    Etcher is a great, simple, open source software used to create bootable media. Use Etcher to select your downloaded copy of Raspian. Next, select your micro SD card as the volume to burn to. Then click go! It will take several minutes to write the OS to the micro SD and then validate the burn. Once it’s complete, eject your SD card and you’re ready for the next step.

    Boot your new Raspberry Pi

    With your freshly burned SD card inserted into your Pi, connect the keyboard, mouse, and monitor, and plug power into your pi. There isn’t a power button on the pi, so as soon as power starts running through the board, it will automatically start the boot process. You should be greeted with a simple setup wizard to help you configure some settings that will be applied every time you boot your pi in the future.

    That’s it! Enjoy your new Pi!

    matt

    April 30, 2019
    Lifestyle, Linux, Raspberry Pi
    debian, DIY, linux, pi, raspberry pi, raspberry pi 3, raspberry pi 3 b+, raspian, setup

Prove all things; hold fast that which is good. 1 Thess 5:21