01:shell Basic Use

Source: Internet
Author: User

1.1 Write a login welcome script
(1a new script file, welcome.sh, is used to output various monitoring information. [[Email protected]~]#vi/root/welcome.sh#!/bin/bashEcho"Number of open processes: $ (PS aux | wc-l)"Echo"number of logged-in users: $ (who | wc-l)"Echo"root Partition Disk usage: $ (df-h | grep"/$"| awk ' {print $4} ')"[[Email protected]~]#chmod +x/root/welcome.sh(2) Modify/root/. bash_profile file, call the welcome.sh script program. [[Email protected]~]#Vi/root/.bash_profile#Add this statement at the end of the file/root/welcome.sh (3log back in with the root user to verify the output information for the welcome script. Last Login:mon Feb26 14:52:41 2018 from1.1.1.100Number of open processes:183number of logged-in users:4root partition disk idle:7.4G
Write a login welcome script

01:shell Basic Use

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.