Browse Category: Linux

Date format in Shell script

When we need date format?

You of course sometime will need date time output for such as backup file, this article will show you the standard date format in shell script.

1. Syntax

date +FORMAT
OR
date +"%FORMAT"
OR
date +"%FORMAT-%FORMAT"
Example: In your terminal screen, type the following date command

date +"%d-%b-%Y:%l-%M-%S"

The output of date format will have the follow format 30-Dec-2015:11-49-05 The full explanation of all format will be listed at the bottom of this article Continue Reading

Linux and Unix alias command

Introduction

Linux and Unix alias command is very useful. With alias you can make a shortcut to commands or a new friendly bash shell command that you like to run a different, preferred term and complex bash shell command. For example: instead of “cd ..” command, you can type only “..” Aliases persist for the current session. They can be loaded at login time by modifying the shell’s .rc file. This article will show you how to create new alias command, remove alias command and more familiar with it. Continue Reading

bash script backup mysql database

Bash script backup MySql database

As we all know, databases is one of the most important thing you need to backup before you want to upgrade, move to new server or before you want to do a task but do not really sure about the impact. I have written a article about the command line to MySql database - How to Backup and Restore. In this article, I will show you a little bash script backup MySql database at regular intervals and deleting backups which older than 15 days from current.

This Bash script backup MySql will contain your database information so please make sure you set the right permissions, more over please don’t place the backup folder in public_html folder othervise other people will be able to see the content of your database. Continue Reading

Linux Users and Groups

Linux Users and Groups – Base knowledge

Linux Users and Groups are very important knowledged. If you are new to Linux/Unix, then the concept of permissions may be confusing. This guide will provide you with an explanation of what permissions are, how they work, and how to manage them.

Definition: User and Group Permissions

As other operation system, Linux/Unix has the ability to multitask in a manner. However, Linux’s major difference from other operating systems is its ability to have multiple users and allow more than one user to have access to the system at the same time. In order for this multi-user design to work properly, there needs to be a method to protect users from each other. This is where permissions come. Continue Reading

Vi command line

Learn Linux: use vi command

Vi command overview

In other post, we showed you some most useful Linux commands, you can check that article here. Today, we will show you detail about a very useful command when we working with linux. That is vi command. VI command is on almost every UNIX and Linux system. This tutorial will show you how to

  • Navigate a document using vi command
  • Use basic vi modes
  • Insert, edit, delete, copy and find text by vi command

Continue Reading

linux command line

Linux Command line should know

How important?

Let’s say you have a VPS server and you want to manage your web application, you can not handle it without the knowledge of Linux command line. The Linux command line may seem daunting, complex and scary, actually it is quite simple when you understand what is going on. This tutorial will help you understand and categories the list of linux command line that we often use. Continue Reading