Shell Script Example – Linux

linux

Shell Script Example – Linux for ((j=12;j<=31;j++)); do echo $j year=2020 month=01 day=$j mkdir /mnt/recording/final/11/$year-$month-$day results=($(mysql –user name -ppassword -h 192.168.2.4 db -Bse “SELECT id FROM calldetails  WHERE calldate BETWEEN ‘$year-$month-$day 00:00:00’ AND ‘$year-$month-$day 23:00:00′”)) cnt=${#results[@]} for (( i=0 ; i<cnt ; i++ )) do a=${results[$i]} echo auid=$a; cp /home/data/$year-$month-$day/$a.gsm /mnt/recording/final/11/$year-$month-$day/$a.gsm done done  

Shell Script : Nested for loop statement

linux

Shell Script : Nested for loop statement Nested for loops means loop within loop. They are useful for when you want to repeat something serveral times for several things. For example, create a shell script called nestedforloop.sh: #!/bin/bash # A shell script to print each number five times. for (( i = 1; i <= … Read more

Rename Multiple Files In Linux using mmv command

rename files in linux

Rename Multiple Files In Linux using mmv command mmv moves (or copies, appends, or links, as specified) each source file matching a from pattern to the target name specified by the to pattern. yum install mmv Let us say, you have the following files in your current directory. $ ls a1.txt a2.txt a3.txt Now you want … Read more

How to Install Visual Studio Code on CentOS 7

Visual Studio Code is an open-source cross-platform code editor developed by Microsoft. It has a built-in debugging support, embedded Git control, syntax highlighting, code completion, integrated terminal, code refactoring and snippets. Prerequisites You’ll need to be logged in as a user with sudo access to be able to install packages. Installing Visual Studio Code on … Read more

How to Install Wine 2.9 in Ubuntu:

The official Wine repository has built the packages for Ubuntu 14.04, Ubuntu 16.04, Ubuntu 16.10, Ubuntu 17.04. Follow the steps one by one to add the repository and install Wine 2.9: 1. Open terminal via Ctrl+Alt+T, and run command to install the key: wget https://dl.winehq.org/wine-builds/Release.key && sudo apt-key add Release.key 2. Then add the Wine … Read more

How to Extract Information about Hardware Components

You can also use the dmidecode utility to extract hardware information by reading data from the DMI tables. To print information about system, run this command. To print information about BIOS, run this command. To print information about processor, run this command.

How to Print PCI Devices Information

PCI devices may included usb ports, graphics cards, network adapters etc. The lspci tool is used to generate information concerning all PCI controllers on your system plus the devices that are connected to them. Use the -t option to produce output in a tree format. Use the -v option to produce detailed information about each … Read more