Tag archives for linux - Page 3
Install RPM in CentOS
Install RPM in CentOS RPM Package Manager (RPM), originally called the Red-hat Package Manager, is a program to install or uninstall software packages or libraries in Linux. To install RPM in CentOS, first download the RPM: $ wget now check in your directory will be available for install RPM in…
Rename all Files in the Directory
Here is the simple shell script to rename all files in the folder with increasing number. In below example I am going to rename all jpg image with increasing number. #!/bin/bash a=1 for i in *.jpg; do new=$(printf "%" "$a") mv -- "$i" "$new" let a=a+1 done Output: Few more…
Run Mysql Query from Command Line
Shell script to run mysql query from command line without login into mysql command prompt. You can use these shell script for quickly execution of MySQL query from a Linux Shell. Method 1: #!/bin/bash #Script to run mysql query from command line #Db Connection. DB_USER='root' DB_PASSWD='mypwd' DB_NAME='mydb' #Prepare sql query QUERY='select *…
Start mysql service if not running
Here is the simple shell script check the MySQL service status, if MySQL service is not running then start MySQL service. #!/bin/bash SERVICE='mysql' if ps ax | grep -v grep | grep $SERVICE > /dev/null then echo "$SERVICE service is running." else echo "$SERVICE is not running" service mysqld start…
Run Jenkins Build From Command Line
Run Jenkins build from command is very simple in Linux system. Jenkins has support to command line client that allows you to access Jenkins from command line. To Trigger Jenkins build from command line some prequiste are there Jenkins service is running. Enable security option under "Configure Global Security" Go…
