• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Archives for July 2020

What is the purpose of utmp, wtmp and btmp files in Linux

by admin

In a Linux system, everything is logged in a log file under the directory called /var/log. This directory contains logs related to different services and applications. In this directory we have some files such as utmp, wtmp and btmp. Unlike the system log files and the authentication log files, all of these files are binary […]

Filed Under: Linux

How to (Correctly) Change the UID and GID of a user/group in Linux

by admin

Changing the UID and GID of a user might seem a trivial task to most of the system admins. But it’s not so trivial and it involves a lot more changes in the backend. In this post, we have outlined the exact steps to change the UID and GID of a user “user01”. Username: user01 […]

Filed Under: Linux

PHPMyAdmin :: Existing configuration file (./config.inc.php) is not readable

by admin

The Problem I have just installed LAMP on my CentOS machine and while trying to access phpMyadmin thorugh cPanel, get below error: Existing configuration file (./config.inc.php) is not readable. The Solution The above error is due to the misconfiguration of permissions of the phpMyAdmin configuration file – /usr/local/cpanel/base/3rdparty/phpMyAdmin. Follow the steps outlined below in order […]

Filed Under: Apache

cp: omitting directory – error while copying a directory in Linux

by admin

The Problem When we are trying to copy a directory to other location, we get below error: $ cp /data01 /data02 cp: omitting directory ‘/data01′ $ The Solution The error above is a common mistake done by Linux newbies while copying a directory to other locations without using the recursive copy option in the ‘cp’ […]

Filed Under: Linux

How to Use user-defined Functions in awk

by admin

User-Defined Functions You can create user-defined functions in a awk script file using the func or function keywords. Placement in the file is not important; the function definition can occur anywhere in the awk script. The function can take arguments (local to the function only) or use any existing variable. The syntax of a function […]

Filed Under: DevOps, Shell Scripting

Using Loops (while, for) in awk scripts

by admin

The awk programming language contains many of the programming concepts that are used in shell scripting. Conditionals, such as the if statement and loops, such as the following can also be used in awk programming. The while loop The do while loop The for loop The if Statement The if statement can have two branches: […]

Filed Under: DevOps, Shell Scripting

Beginners Guide to Using “trap” to Catch Signals and Handle Errors in Shell Script

by admin

Shell Signal Values A signal is a message that some abnormal event has taken place or a message requesting another process do something. The signal is sent from one process to another process. Typically, a process sends a signal to one of its own subprocesses. You can obtain more information on signals from the signal […]

Filed Under: DevOps, Shell Scripting

How to Make a Variable read-only (constant) in Bash and Korn Shell

by admin

Creating Bourne Shell Constants A variable can be made read-only with the following syntax: readonly var[=value] The square brackets around =value mean that the assignment of a value is not always necessary. For instance, if the variable had previously been created and assigned a value, and you now want to make it read-only (and not […]

Filed Under: DevOps, Shell Scripting

Examples of “shift” Command in Shell Scripts

by admin

The shift Statement Sometimes a script does not require a specific number of arguments from users. Users are allowed to give as many arguments to the script as they want. In these situations, the arguments of the script are usually processed in a while loop with the condition being (($#)). This condition is true as […]

Filed Under: DevOps, Shell Scripting

Korn Shell select Loop

by admin

The select statement in the Korn shell creates a menu. This construct is for the Korn shell only. The syntax for creating a menu is: select var in list do statement1 … statementN done The variables var and list follow the same syntactic rules used in the for loop (although the operation of the select […]

Filed Under: DevOps, Shell Scripting

Next Page »

Primary Sidebar

Recent Posts

  • gml2gv Command Examples
  • glow Command Examples
  • glib-compile-resources Command Examples
  • glances Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright