linux

fish shell alvin November 27, 2018 - 10:44am

From the URL I linked to, “fish is a fully-equipped command line shell (like bash or zsh) that is smart and user-friendly. fish supports powerful features like syntax highlighting, autosuggestions, and tab completions that just work, with nothing to learn or configure.”

Elementary OS: The prettiest Linux desktop yet alvin November 16, 2018 - 5:08pm

I haven’t tried it yet, but from all of the images I’ve seen, Elementary OS looks like the prettiest desktop Linux distribution I’ve ever seen. I hope to install it this weekend and take it for a spin.

Scala code to find (and move or remove) duplicate files

My MacBook recently told me I was running out of disk space. I knew that the way I was backing up my iPhone was resulting in me having multiple copies of photos and videos, so I finally decided to fix that problem by getting rid of all of the duplicate copies of those files.

So I wrote a little Scala program to find all the duplicates and move them to another location, where I could check them before deleting them. The short story is that I started with over 28,000 photos and videos, and the code shown below helped me find nearly 5,000 duplicate photos and videos under my ~/Pictures directory that were taking up over 18GB of storage space. (Put another way, deleting those files saved me 18GB of storage.)

The Red Hat ethos alvin November 8, 2018 - 6:09pm

The URL contains a statement of the Red Hat ethos. A couple of good quotes:

Open source is a development model, not a business model. Red Hat is in the enterprise software business and is a leading provider to the Global 500. Enterprise customers need products, not projects and it’s incumbent on vendors to know the difference. Open source projects are hotbeds of innovation and thrive on constant change. These projects are where sometimes constant change happens, where the development is done.

Microsoft’s Steve Ballmer: Linux is a cancer alvin October 29, 2018 - 8:05am

As I was reading a blog post titled, What Makes Us Red Hat, I came across the article summary shown in the image where Microsoft’s Steve Ballmer refers to Linux as a cancer. Note that his description of open source license agreements is about as honest as today’s politicians.

How to easily determine the blocksize of a filesystem alvin August 29, 2018 - 2:34pm

I just saw that this is a way you can easily determine the blocksize of a filesystem, at least a Mac/Unix/Linux filesystem:

$ echo foo > foo

$ du -h foo
4.0K    foo

I tried to do the same thing with touch foo, but that didn’t work. Without digging into it more, the key seems to be in having very little text in the file, at which point the du command shows the minimum block size for the file.

A big collection of Unix/Linux ‘find’ command examples

Linux/Unix FAQ: Can you share some Linux find command examples?

Sure. The Unix/Linux find command is very powerful. It can search the entire filesystem to find files and directories according to the search criteria you specify. Besides using the find command to locate files, you can also execute other Linux commands (grep, mv, rm, etc.) on the files and directories you find, which makes find extremely powerful. 

How to use the Linux ‘scp’ command without a password to make remote backups alvin August 7, 2018 - 11:25am

Summary: How to create a public and private key pair to use ssh and scp without using a password, which lets you automate a remote server backup process.

Over the last two years I've ended up creating a large collection of websites and web applications on a variety of Linux servers that are hosted with different companies like GoDaddy and A2 Hosting. I recently embarked on a mission to automate the backup processes for all these sites, and as a result of this effort, I thought I'd share what I've learned here.

Unix find command: How to move a group of files into the current directory alvin May 16, 2018 - 9:51pm

I just bought a bunch of MP3 music files from Amazon, and when I downloaded the zip file they provide onto my Mac, it was a bunch of files in a bunch of subdirectories; not really convenient to work with when you’re trying to import them into iTunes. So I used this Unix find command to move all of the music files from the subdirectories they were scattered in into the root directory that was created when I expanded the zip file:

cd Amazon-Music-Folder
find . -type f -exec mv {} . \;

If you ever need to either copy or move a bunch of files with a single command, I hope this example shows the correct find command syntax for your needs. (If you need to copy the files, use the cp command instead of the mv command.)