≡ Menu

Linux

C argc and argv Examples to Parse Command Line Arguments

Whenever you execute a program on a terminal, you can pass some arguments that are expected by the program, which can be used during the execution of the program. Here, system provides internal facility to maintain all arguments passed from user while executing program. These arguments are known as “Command line arguments”. In this tutorial, [...]

{ 10 comments }

Once you insert new hard disks into your system, you’ll typically use utilities like fdisk or parted to create partitions. Once you create a partition, you’ll use mkfs command to create ext2, ext3, or ext4 partition. Once you create a partition, you should use mount command to mount the partition into a mount point (a [...]

{ 21 comments }

There are times when you need to port an object file available for one kind of platform (like ARM or x86) to another kind of platform. Things are relatively easy if the source code is available as it can be re-compiled on the target platform. But, what if the source code is not available and [...]

{ 3 comments }

How to Install MongoDB from Source (and using YUM) on Linux

The name MongoDB was derived from Humongous DB. It is an open source NoSQL database. MongoDB is developed and commercially supported by the company 10gen. The focus of the MongoDB is on scalability and performance. MongoDB is a schema-free document-oriented database. This stores data as JSON objects. Unlike traditional SQL database, you don’t need to [...]

{ 7 comments }

There are times when it is required to mix the C and C++ code together. For example, while using a legacy C code or while using a specific C library the provides your C++ code with some specific functionality. So, some special steps are to be taken care of when using C code in C++ [...]

{ 8 comments }

Linux mkfs, mke2fs Command Examples (Create ext2, ext3, ext4 Filesystem)

mkfs utility is used to create filesystem (ext2, ext3, ext4, etc) on your Linux system. You should specify the device name to mkfs on which the filesystem to be created. WARNING: Executing these commands will destroy all the data on your filesystem. So, try these commands only on a test system where you don’t care [...]

{ 16 comments }

8 Linux TR Command Examples

tr is an UNIX utility for translating, or deleting, or squeezing repeated characters. It will read from STDIN and write to STDOUT. tr stands for translate. Syntax The syntax of tr command is: $ tr [OPTION] SET1 [SET2] Translation If both the SET1 and SET2 are specified and ‘-d’ OPTION is not specified, then tr [...]

{ 25 comments }

5 Linux Touch Command Examples (How to Change File Timestamp)

Every file in Linux is associated with timestamps, which specifies the last access time, last modification time and last change time. Whenever we create a new file, or modify an existing file or its attributes, these timestamps will be updated automatically. Touch command is used to change these timestamps (access time, modification time, and change [...]

{ 15 comments }