Division Functions in Linux kernel

On 64 bit Linux kernel, division (/) and modulus operator (%) will behaved as expected. GCC C compiler generates code that calls functions in the libgcc library to implement the / and % operations with 64-bit operands on 32-bit CPUs. Linux kernel is not linked against the libgcc library, so [...]

By |2021-04-07T11:37:16+05:30April 7th, 2021|Categories: Linux|

How to find script file name in a Bash script?

Sometime we want to know the file name of the script which we are executing in bash scripting. One such scenarios is use the file name for logging purpose, without hardcoding the name of the script file. In the below example, readlink prints out the value of a symbolic link. [...]

By |2021-04-06T12:45:57+05:30April 6th, 2021|Categories: Linux|Tags: |

Linux Kernel Debugging

Various debugging technique are available for Linux Kernel Debugging. Most common of them is adding log and printing them using printk. This post list various technique which are useful for debugging a issue. Adding Additional Log printk is similar with printf on C standard library. It can be called from [...]

By |2021-03-21T00:45:38+05:30March 20th, 2021|Categories: Linux|

Configuration Options for Debugging Linux Kernel

Linux supports various configuration options for debugging Linux Kernel. Some of these options are not supported on all the platforms. Some of the available configuration options are CONFIG_DEBUG_KERNEL : It makes other debugging options available, but does not enable any features.CONFIG_DEBUG_SLAB : This option turns on several types of checks [...]

By |2021-03-20T23:38:39+05:30March 19th, 2021|Categories: Linux|Tags: |

Export Command in Linux

Introduction export command in Linux marks an environment variable to be exported with any newly forked child processes and thus it allows a child process to inherit all marked variables. Frequently Used Options -p : List of all names that are exported in the current shell-n : Remove names from [...]

By |2021-03-19T23:57:20+05:30March 19th, 2021|Categories: Linux|

Source Command in Linux

The source command read and execute commands from the filename argument in the current shell context. When a script is run using source it runs within the existing shell, any variables created or modified by the script will remain available after the script completes. In contrast if the script is [...]

By |2021-03-14T00:36:00+05:30March 13th, 2021|Categories: Linux|

Time Command in Linux

The time command in Linux runs the specified program command with the given arguments. When command finishes, time writes a message to standard error giving timing statistics about this program run. It shows Elapsed real time between invocation and terminationUser CPU time, i.e. amount of CPU time spent in user [...]

By |2021-03-12T01:45:54+05:30March 12th, 2021|Categories: Linux|

What is /dev/null in Linux ?

The /dev/null device is a special file that discards all data written to it but reports that the write operation succeeded. It is typically used for disposing of unwanted output streams of a process. This is usually done by redirection. /dev/null is creaetd every time on system boot. From the [...]

By |2021-03-12T01:10:44+05:30February 26th, 2021|Categories: Linux|

Hard Link and Soft Link in Linux

Hard link and Soft link (Symbolic link) in Linux are two different methods to refer to a file in the hard drive. Inode Each file has one inode that contains information about that file, including the location of the data belonging to that file. Every file must have at least [...]

By |2021-01-17T19:03:23+05:30January 17th, 2021|Categories: Linux|

Modifying File Ownership in Linux

The chown command in Linux is used to modify the owner and group of files, directories and links. By default, the owner of a filesystem object is the user that created it. The group is a set of users that share the same access permissions (i.e., read, write and execute) [...]

By |2021-01-17T17:00:30+05:30January 17th, 2021|Categories: Linux|
Go to Top