Category Archives: Linux

You got to love Linux. Not only that it is free, but it is also very strong, stable, and widely used.

Remove all svn directory

Subversion (SVN) sometimes clutter our source directory by creating .svn folder in each folder or sub folder that we version control. The easiest way to erase them is by using a bash command: 1find . -name ".svn" -type d -exec … Continue reading

Posted in Linux, Version Control | Leave a comment

SVN Tricks in Linux

To show colorized svn diff 1sudo aptitude install colordiff Then on your home directory there is a hidden file called .bashrc. Edit it. 1vim ~/.bashrc Append the following code at the end of the file 1234svndiff() {   svn diff … Continue reading

Posted in Linux, Operating System, Version Control | Leave a comment

Displaying Linux Distro Version and Showing 32Bit or 64Bit OS

Checking whether you have 32bit linux or 64bit linux. From the code below we can see that it is a 64 bit linux. 12[user1@ubuntu 17:14:37 ~/dev]$ uname -mrs Linux 3.2.0-30-generic x86_64 Checking which distro you’re using: 123456[user1@ubuntu 17:14:48 ~/dev]$ lsb_release … Continue reading

Posted in Linux, Operating System | Leave a comment

Find and Replace File Content using Linux Command Line

1find . -name "*.pgsql" -print | xargs sed -i ‘s/STRINGTOREPLACE/REPLACERSTRING/g’

Posted in Linux, Operating System | Leave a comment

How To List All Users or Groups in Linux

To list all users in Linux: 1cat /etc/passwd See only the first word before double colon (:) for exampple, user “root” will look like: root:x:0:0:root:/root:/bin/bash And to list all groups do the following 1cat /etc/group

Posted in Linux, Operating System | Leave a comment

Preventing Another Instance of A Program Running in Linux

The code below is my solution for preventing a program from running more than once at the same time in Linux. The scenario: Consider if you have a cron job (jobA.sh) set to run at 6PM, 7PM, and 8PM. While … Continue reading

Posted in Linux, Operating System | Leave a comment

MySQL Backup and Restore – Using Command Line

Here’s how you back up a database from the command line. The first line is the backup, the second is the restore. These commands work on both Windows and Linux. On Windows you might want to add the MySQL bin … Continue reading

Posted in Database, Linux, MySQL | Leave a comment

Benchmark How Long a Program Runs In Linux Using Bash

The following bash code might come in handy if you want to benchmark how long a program runs. The example assumes you want to pass two parameters along to the program. A timestamp is captured at the start and end … Continue reading

Posted in Linux, Operating System, Ubuntu | Leave a comment

Auto Login Using SSH Public and Private Keys

2026 update: This post originally used ssh-keygen -t rsa. The current recommendation (e.g. GitHub’s SSH key guide) is Ed25519 — it produces shorter keys, is faster, and is considered more secure. Use RSA (4096-bit) only as a fallback for systems … Continue reading

Posted in Linux, Operating System, Ubuntu | Leave a comment

Linux symlinks: creating, deleting, and the gotchas worth knowing

The basic command for creating a symbolic link (a “symlink” or “soft link”) to a folder or file is ln -s: 12345678ln -s /home/ronald/somefolder /home/ronald/newfolder # or if your current directory is already /home/ronald: cd /home/ronald ln -s somefolder newfolder … Continue reading

Posted in Linux, Operating System, Ubuntu | Leave a comment