what’s the need for getopts shell builtin?
The 'getopts' command is a built-in tool in shell scripting. It helps in handling different types of input when working with scripts. It can process information in two ways: It…
The 'getopts' command is a built-in tool in shell scripting. It helps in handling different types of input when working with scripts. It can process information in two ways: It…
madhu@madhu-Inspiron-5567:~$ sudo cd /root [sudo] password for madhu: sudo: cd: command not found If you encountered the mentioned error after running sudo with the "cd" command, it occurred because: The…
Imagine having millions of small files within a directory. When attempting to delete files in the directory that match a specific pattern using the "rm -rf" command, or to remove…
Script to change a common password of all the ESXIs in a vCenter: #need to enter the current root password at command line $rootpswd = read-host "Please enter the current…
1) VMware PowerCLI Script using Linux PowerShell (pwsh-preview), which has the "VMware.PowerCLI" module installed. Connect-VIServer -Server myvcenter.mylearningsguru.com -User username -Password password New-VIProperty -Name VMToolsStatus -ObjectType VirtualMachine ` -ValueFromExtensionProperty 'Guest.ToolsStatus' `…
apt-get is a command-line tool in the Ubuntu OS used for installing, removing, upgrading, and updating packages. It can also be employed to upgrade the entire operating system. 1) Updating…
In certain scenarios, especially when numerous Docker containers are operational within a server host, it becomes pivotal to identify the specific veth interface associated with each container. This enables us…
Bash scripts offer a range of special variables that prove incredibly valuable when handling arguments within a Bash script. $0 Prints filename of the script.$1, $2 ….. $n $1 is the…
1) First, we need to start the ssh-agent (this program holds private keys for public key authentication) using the command.ssh-agent bash2) Now, we need to add the private key, along…
PermitRootLogin: The PermitRootLogin options solely determine whether direct login as the root user via SSH to the server is permissible. The valid arguments for this directive are: no, yes, forced-commands-only,…