Author: Surendra Anne

Git tool mind map for easy learning

This is our third post on “30 mindmap series” from “The Linux Juggernaut”. In this post, we are sharing GIT tool for understanding it from different angles. We tried to include couple of things Git commands Git concepts Git stages Git terminology Git installation and setup Git public services GIT mind...

Read More

6 Ruby substrings examples

The substring is a part of string/variable. We can create substrings from a ruby string variable. We already dealt with substrings in Shell scripting in our early post. This substring can be one character length or multiple characters length. Below are some examples which we are going to have a look. Print first character of a string Print first n characters of a string Print nth character of a string Print from nth to mth character of a string Print last character of a string Print last n characters of a string. Bit of background for Ruby string indexes As Array’s have indexes to access elements of an array, Strings/Variables to have index values. The first character of a string index number is 0; the second one is 1 and so on. If you want to get last character index either you have to count some character in that string or use negative numbers. For example, if you want the last element of a string use -1, last but one use -2, etc. We use Ruby IRB, which is an interactive Ruby Shell to show examples in this post. In this post, my string str1 is set to “The Linux Juggernaut.” Print first character of  Ruby variable To print first character use index ‘0’ as shown below. Example: irb(main):001:0> str1 = 'The Linux Juggernaut' => "The Linux Juggernaut" irb(main):002:0>...

Read More

Linux directory structure: /lib explained

We already explained other important system folders like /bin, /boot, /dev, /etc etc folders in our previous posts. Please check below links for more information about other stuff which you are interested. In this post, we will see what is /lib folder all about. Linux Directory Structure explained: /bin folder Linux Directory Structure explained: /boot folder Linux Directory Structure explained: /dev folder Linux Directory Structure explained: /etc folder Linux Directory Structure explained: /lost+found folder Linux Directory Structure explained: /home folder   What is /lib folder in Linux? The lib folder is a library files directory which contains all helpful library files used by the system. In simple terms, these are helpful files which are used by an application or a command or a process for their proper execution. The commands in /bin or /sbin dynamic library files are located just in this directory. The kernel modules are also located here. Taken an example of executing pwd command. It requires some library files to execute properly. Let us prove what is happening with pwd command when executing. We will use the strace command to figure out which library files are used. Example: root@linuxnix:~# strace -e open pwd open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 /root +++ exited with 0 +++ root@linuxnix:~# If you observe, We just used open kernel call for pwd command. The pwd...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe

ABOUT ME..!

My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.