How to use shell command completion in Solaris

Source: Internet
Author: User
Although Solaris10x86 can run, it is not used in many aspects as it was previously. This article focuses on some Shell problems in Solaris, that is, solutions. After the system is installed, the default Shell of Solaris is sh, that is, the command line prompt is (all mentioned in this article...

Although Solaris10 x86 can run, there are many aspects that are not the same as before. This article focuses on some Shell problems in Solaris, that is, solutions.

After the system is installed, the default Shell of Solaris is sh, that is, the command line prompt is (all users described in this article are root users, and users with other permissions are the same)

In the Linux command line prompt, there are user names, host names, and the name of the current path. This will give people a clear impression. However, in Linux, the default Shell is bash, not sh. If you only want to switch the Shell in the current use, the method is very simple. you can enter the following in the command line:

# Bash // switch to bash
Or
# Csh // switch to csh

If you need to change the default shell permanently, you need to modify the/etc/passwd file. When passwd is enabled, the first line records the relevant information of the root user. the content of this line is:

Root: x: 0: 0: Super-User: // sbin/sh

Here, the last colon is followed by the default shell of the root user. we will change it to the bash path:

Root: x: 0: 0: Super-User: // usr/bin/bash

Save the file passwd and exit.

In this way, you can use the Tab key to complete the input of the command line and the up and down arrows to play back the history of the input command, but sh does not have this function. However, this modification alone does not enable the command line prompt to show that there are both user names and host names and the current path name in the Linux prompt.

You need to edit another file. Create a file. profile under $ HOME. if the file exists, add content to it. Because it is a root user, the $ HOME path is the root directory /. Create a file. profile in the root directory and add the following content to it:

PS1 = '[\ u @ \ h: $ PWD] #'
Export PS1

Save and exit the file and restart the system. After entering the system, open a terminal and the command line prompt is:

[Root @ solaris:/] #

Run the following command:
[Root @ solaris:/] # echo $ SHELL // view the default shell of the system
/Usr/bin/bash

Run the following command:
[Root @ solaris:/] # cd home
The command line is changed:
[Root @ solaris:/home] #

Root indicates the user name, solaris indicates the host name, and/home indicates the current path.
Of course, if you are used to csh, you can switch the shell to csh first. Then, enter the following command:

# Set filec

In this way, you can complete the command line in csh. However, the complete input uses the ESC key instead of the Tab key.

Original address: http://www.linuxdiyf.com/viewarticle.php? Id = 78474

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.