How to use Xcode for C and C++ development

Not only is Xcode an excellent IDE for iOS and macOS apps in both Swift and Objective-C; it does just as fine a job for regular C and C++ code. This includes all the features we know and love, such as code completion, version control, and all the rest of it.

Let’s see how to use Xcode 8.3 for C and C++ development.

A Chinese Version of this article can be found here.

Read more

How to exit VI with or without saving

Although many alternatives exist, I like using vi for all my command line editing needs. To save changes, I usually use SHIFT + Z + Z, exiting vi under most circumstances. But sometimes, this trick doesn’t work because of write permission problems. In such cases, vi doesn’t close with the above command. Instead, we must … Read more

How to read command line parameters in BASH Scripts

Shell Scripts (BASH Scripts) can access command line parameters using the the variables $1, $2, $2 and so forth, up to $9. In fact, more parameters can be accessed by using curly brackets, like ${10}, ${187} and so forth. Here’s an example: #!/bin/bash if [[ $1 == “x” ]]; then echo “Statement is true” else … Read more

How to extract files from a bz2 archive in Linux

If you’ve ever tried to decompress a file that ends in tar.bz2 using the tar command with the standard -x option, you’ll have noticed that it doesn’t work. That’s because some versions of tar don’t understand the bzip2 codec used in these archives. However, you can tell tar to use this option by specifying the … Read more