Use shell scripts to automatically configure the Work Environment

Source: Internet
Author: User

Development Environment: Ubuntu 11.10 + gnome classic

 

The terminal command line window we use in the GUI environment is actually gnome-terminal. You can enter this command to start the command line window. It has some usage

$ Gnome-Terminal

$ Gnome-terminal -- window # open a new window

$ Gnome-terminal -- tab # open a command line window with two tabs

$ Gnome-terminal -- tab -- profile = default # load the default configuration file. defalt is the default configuration file.

About the configuration file

Gnome allows you to create a configuration file (File/new configuration file) and manage it (edit/configure file) through the window menu. You can specify the style and font for each configuration file, you can also specify the command to be executed when the window or tab of the configuration file is started (it seems that only one command is allowed? And can't execute the CD command ?), Therefore, we can use the configuration file to do some work every day. For example, the first thing after I start my job every day is to open the Database Management Terminal, view logs, and use SVN up to download my colleague'sCode, I just want to automate the completion, instead of writing commands every day :) gnome official documentation here: http://library.gnome.org/users/gnome-terminal/stable/gnome-terminal.html

 

Configuration File

Apachemgr: sudo service apache2 restart

Mysqlmgr: mysql-uroot-pdh6 ***** 132e tnv2

Logmgr: tail-F/tmp/error. Log

Svnmgr: SVN up

Select Execute Command for each configuration file and keep the window open.

 

Write another shell script profile. SH and put it in the main directory.

 
#! /Bin/bash

Echo profile...
Cd ~ /Workspace/Hp2
#Start Dev tools
#/Home/shujunli/Aptana \ studio \ 3/aptanastudio3

#Start help tools
Gnome-terminal -- tab -- profile = apachemgr -- tab -- profile = logmgr -- tab -- profile = mysqlmgr -- tab -- profile = svnmgr -- Tab

In this way, you can execute a command every day to execute so much work. Further, I drag it to the menu bar and the shell window can be opened after each click.

There is something similar to Gnome calledXterm You can also enter this command to open a shell window, but haven't tried it yet.

Xterm-e mysql-uroot-pdh6svp132e tnv2 # Open the new xterm window and execute the command. However, non-interactive commands will end immediately after execution.

Xterm is a standard virtual terminalProgramSimulate the terminal of the mainframe. Details are unknown.

 

Related Article

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.