customizing Linux commands

Source: Internet
Author: User

?

Method One, modify the/ETC/BASHRC file

Add at the bottom of the file

Alias zone= "Cd/usr/local/webserver"

  

Entering zone at the command line will go directly to the development directory

Method Two, establish shell script implementation

1. Create a file logtail.sh

#!/bin/bashif [$#-gt 2]; Then   echo "Param Error" fidefault_path= "/wwwroot" path=${default_path}default_file_name= "Php_errors.log" FILE=$ {default_file_name}if ["x$1"! = "X"]; Then     path=$1fiif ["x$2"! = "X"]; then     file=$2fi/usr/bin/tail-f "${path}/${file}" Exit 0

  

?

2. Testing

SH logtail.sh

3. Modify the name

MV Logtail.sh Logtail

4. Move the Logtail to/usr/local/bin

MV Logtail/usr/local/bin/logtail

5. Assigning Permissions

Chmod-r 755 Logtail

6. Testing

Direct use of commands

Taillog

customizing Linux commands

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.