Tag Archives: tutorial

Linux – Find Command Examples and Tutorial

The find command is a powerful and versatile tool that can do much more than search for files. There are many ‘tests’ that can be added to make the search as specific as needed. Complex searches can then be combined with ‘actions’ to be performed on files that match. Here are a few examples:

***  ALWAYS perform searches first with NO COMMANDS on the end (like -delete or -exec). There is NO UNDOING a bad command so make sure you know what files will be affected.  ***

  • Find files by name (such as copies). As with many commands, the argument right after find tells it where to start looking. Using . says to start looking from the terminal’s current directory. The -name test uses unix-style wildcards and must match a complete file or directory name. Placing a * on each side of your query will find it in the middle of a name. The last part is a test for file type. The most common flags for -type are f for file, d for directory, and l for symbolic link.
  • Find empty folders and delete them. Here were are replacing the -name test with a simple check for -empty because we are looking for empty directories. We can then specify -type d to find only directories. The last part is a call to the action -delete. Use this carefully and remember, always search first and only use actions after you know what will be affected.
  • Find iPhone screenshots and move them to a screenshots folder. This example uses the -exec action flag, which can be used to perform almost any command on the found files. This flag really shows off the incredible usefulness of the find command. This time, were are not searching from current directory, but telling find to start from the “~/iPhonePics” folder. For the -name test, we are looking for any files ending in “.png”; so in this case we need only one wildcard to fill out the start of each filename: “*.png”. The -exec action has extra requirements for a complete command. Brackets {} are where each found file path will be inserted into the command. Also, the command must be finished off with \; to let find know that’s the end. In this case, the mv command will be performed on each file and told to move them from anywhere in “iPhonePics” to my “~/Screenshots” folder.

I hope these three varied examples have given you inspiration on how to add the Linux find command into your tools. I am using this on Ubuntu 14.04 and version 4.4.2 of GNU findutils. Whatever version or Linux system you have it should work about the same. Please ask in the comments below if you have any questions! Have a great day!

Install Light Table on Ubuntu with Launcher

Recently I’ve been trying out the open source editor Light Table. It has a lot of great features, my favorite being inline evaluation. The editor will run a single line of code and display the value at the end! It’s super customizable and really reminds me of Sublime Text in terms of looks.

Here are some simple instructions on how to install Light Table and create a nice launcher for it.

  • Download the correct version for your system from lighttable.com.
  • Change directory to wherever the file is located.
  • Unzip the archive. This will give you a folder called LightTable. The wildcard ‘*’ in the filename makes this command work for either the 32-bit or 64-bit downloads.
  • Move the unzipped folder to /opt to live with other non-traditional installations. Then delete the archive. Note: Programs in /opt are available to all users.
  • Create a launcher file called light-table.desktop and enter the details to make it work.

    Make sure to hit enter at the end to leave a blank line, then hit Ctrl+D to exit the cat command.
  • Make the launcher executable so Ubuntu registers it as a program.
  • Last step is to create a symlink in your user /bin folder to enable calling Light Table from a terminal. You can call yours whatever you want, but here I’ve named it ltable so the command to start it up is nice and short.

    Edit: If ~/bin does not exist, create it. Ubuntu treats ~/bin like a per-user installation folder. If you want this shortcut to be available for all users, instead use sudo and place it in /usr/local/bin.

That’s it! All done! Have fun using and customizing the Light Table editor! I’m certainly no Light Table expert but if you have any questions about these instructions please let me know in the comments. Have a great day!

How to Make a Portable Minecraft Installation

I love the idea of having a portable Minecraft installation. Syncing between machines or even giving your worlds and mod-setup to a friend. Before Minecraft’s updated launcher, the only way to change the data storage location away from “%APPDATA%\Roaming\.minecraft” was to create a .bat script and set the system’s APPDATA variable.
The updated launcher is about a year old now, but the concept of a portable installation might not be familiar to everyone. The whole process is now much less complicated and can be done mostly through the Profile settings. Here’s how it goes.

  1. Visit https://minecraft.net/download and download Minecraft.exe.
  2. Create a folder wherever you’d like your installation to go. It will be simplest if the location can be the same on any computer you go to. Using a top-level domain such as right in the C:\ drive or in Program Files would be great. If you’re doing it on a flash drive for ease of carrying it around, I suggest copying it to a hard drive while playing and back to the flash when done. Minecraft saves constantly and this will wear out a flash drive pretty fast.
  3. Move Minecraft.exe to the new folder.
  4. Now, to keep your top-level installation folder uncluttered, create a folder inside called data. This will be the replacement for the standard “.minecraft” folder.
  5. Launch Minecraft and login.
  6. Click New Profile and in the new window that pops up check the box Game Directory right below Profile Name.
  7. In the Game Directory text box, put the full path to your portable installation. (Go into your data folder and click the address bar on top to be able to copy that full path, otherwise just type it in)mcportable_settings
  8. Click save profile and that’s it!

Minecraft_Launcher_Steelsouls

The key to keeping this working is that Minecraft always knows where you want to save all the data. It will go looking here when trying to load, including your world saves and mods. Just make sure to remember this when transferring to a new computer.
If I’ve over-complicated anything or you have any questions please let me know in the comments!

Jeweler’s Saw Basics Demo Video

youtube_jewelers_saw_basics_stillframeToday I recorded a video to demonstrate the basics of using a jeweler’s saw. I love teaching skills to others, but making a video has always felt so daunting. Once I got started filming it was way smoother than I expected and actually even fun! Yet another example of the benefits of overcoming fears and just going for it!