View Colored Man Pages in Linux

Pradeep Elance
Updated on 25-Feb-2020 06:24:40

415 Views

The man pages are important reference pages for any Unix user. But their look and feel is very boring because it is just lines of text with some punctuations. In this article we will see how the different parts of the man pages can be coloured and highlighted. That will make it very easy to follow the instructions in the man pages.Using mostThe most command can be used to display the colour man pages but first we have to install it and then add to our bash profile so that it becomes available in the environment. The below command shows ... Read More

Use Images with HTML5 Canvas

Sharon Christine
Updated on 25-Feb-2020 06:21:01

488 Views

The HTML5 tag is used to draw graphics, animations, etc. using scripting. It is a new tag introduced in HTML5. To use images with HTML5 canvas, use the drawImage() method. This method draws the given image onto the canvas.You can try to run the following code to learn how to use images with HTML Canvas. Here, the image is a reference to an image or canvas object. x and y form the coordinate on the target canvas where our image should be placed.ExampleLive Demo                    function drawShape() {   ... Read More

Run a Command with Time Limit in Linux

Pradeep Elance
Updated on 25-Feb-2020 06:20:57

690 Views

Sometimes a Unix command may run for a very long time without giving the final output or it make a processing giving partial output from time to time. In such scenario we will like to put a time frame within which either the command mast complete for the process should abort. This is achieved by using below options.Using timeout ToolThe Timeout tool forces a command tour abort if it cannot complete within a given time frame. Below is the syntax and example.Syntaxtimeout DURATION COMMAND [ARG]... Where Duration is the number seconds you want the command to run Before aborting ... Read More

Find Specific String or Word in Files and Directories in Linux

Pradeep Elance
Updated on 25-Feb-2020 06:20:08

3K+ Views

Many times we need to search for a particular string which may be present in multiple files. In this article we'll see which commands to use to find all the files that contains a particular string or Word.Using grepIt is a powerful regular expression search tool. At a basic level , it will match an input string with the list of files that contain that string.Below is the syntax and the example.grep 'string' directory-path/*.* #Example grep 'config' hadoop-2.6.5/etc/hadoop/*.*Running the above code gives us the following result −hadoop-2.6.5/etc/hadoop/capacity-scheduler.xml: hadoop-2.6.5/etc/hadoop/core-site.xml: hadoop-2.6.5/etc/hadoop/hadoop-policy.xml: hadoop-2.6.5/etc/hadoop/hdfs-site.xml: hadoop-2.6.5/etc/hadoop/httpfs-site.xml: hadoop-2.6.5/etc/hadoop/kms-acls.xml: hadoop-2.6.5/etc/hadoop/kms-site.xml: hadoop-2.6.5/etc/hadoop/mapred-site.xml.template: hadoop-2.6.5/etc/hadoop/ssl-client.xml.example: hadoop-2.6.5/etc/hadoop/ssl-server.xml.example: hadoop-2.6.5/etc/hadoop/yarn-site.xml:Using grep -rIn ... Read More

Decorate Your Linux Terminal Using Shell

Pradeep Elance
Updated on 25-Feb-2020 06:18:46

1K+ Views

The Linux GUI based terminal window has many colours and font settings which can be enhanced as per the user choice. All these can be done using the shell commands and not just by clicking mouse buttons in the GUI component settings.Most of these settings are handled through variables whose value can be changed or assigned by commands. In this article we will see how to handle the terminal prompt settings in Ubuntu based systems.The PS1 VariableIt is a environment variable which controls the primary prompt string which is displayed when the shell is ready to read a command. There ... Read More

Create Animated Art on Your Linux Terminal

Pradeep Elance
Updated on 25-Feb-2020 06:17:05

4K+ Views

Using the characters like - , / or | and many other from the keyboard, we can create animation characters. These characters can be static as well as moving in the screen. All this involves programming using shell scripting. These scripts are bundled into libraries or packages which can be installed in the terminal. Below we will see the examples of these animations.A Running TrainThis package produces a train animation when run from the terminal. But first we install it and then simple type sl in the terminal.$ sudo apt-get install sl $ slRunning the above code gives us the ... Read More

Initialization, Declaration and Assignment Terms in Java

Arushi
Updated on 25-Feb-2020 06:15:44

2K+ Views

A variable provides us with named storage that our programs can manipulate. Each variable in Java has a specific type, which determines the size and layout of the variable's memory; the range of values that can be stored within that memory; and the set of operations that can be applied to the variable.You must declare all variables before they can be used. Following is the basic form of a variable declaration − data type variable [ = value][, variable [ = value] ...] ;Here data type is one of Java's datatypes and variable is the name of the variable. To ... Read More

Create a New ext4 File System in Linux

Pradeep Elance
Updated on 25-Feb-2020 06:14:54

6K+ Views

The hard disk in a computer is formatted with specific file system so that the operating system can read and write into it. For UNIX based systems we have various type of file systems. In this article we will see how to format a new partition in hard disk with ext4 file system.Available Filesystem typesFirst we see what are the different file systems available for the current operating system. The below command lists all those file systems.$ ls -1 /sbin/mkfs*Running the above code gives us the following result −/sbin/mkfs /sbin/mkfs.bfs /sbin/mkfs.cramfs /sbin/mkfs.ext2 /sbin/mkfs.ext3 /sbin/mkfs.ext4 /sbin/mkfs.ext4dev /sbin/mkfs.fat /sbin/mkfs.minix /sbin/mkfs.msdos /sbin/mkfs.ntfs /sbin/mkfs.vfatLook ... Read More

Best Book to Learn Java Programming for Beginners

Daniol Thomas
Updated on 25-Feb-2020 06:14:12

282 Views

Following books are on top from popularity and content wise and are a good resource to learn java programming from beginner to advance level.

Difference Between super and this in Java Program

Mahesh Parahar
Updated on 25-Feb-2020 06:13:14

10K+ Views

Along with various other keywords Java also provides this and super as special keywords which primarily used to represent current instance of a class and it's super class respectively. With this similarity both these keywords have significant differences between them which are listed as below - Sr. No.Keythissuper1Represent and Referencethis keyword mainly represents the current instance of a class.On other hand super keyword represents the current instance of a parent class.2Interaction with class constructorthis keyword used to call default constructor of the same class.super keyword used to call default constructor of the parent class.3Method accessibilitythis keyword used to access methods of ... Read More

Advertisements