Learning Linux (2): Understanding shell and some commands

Source: Internet
Author: User
Tags echo command
Shell:

Shell Baidu Encyclopedia: Baidu. It receives user commands and calls corresponding applications. It is also a programming language. As a command language, it interactively interprets and executes user-entered commands or automatically interprets and executes a series of pre-defined commands. As a programming language, it defines various variables and parameters, it also provides many control structures that are available in advanced languages, including loops and branches.


Interface:

I. graphical user interface shell (GUI shell)
CTRL + F7 is the graphic interface
2. command line interface shell (CLI shell)

CTRL + F1 ~ F6 is the command line interface. To enter the command line interface, first enter the user name, and then enter the password (invisible). After logging on, you can perform a series of operations;


Terminal: Enter the terminal:

(Press super, that is, win, and enter ter.) or press CTRL + ALT + T;

The terminal is also a shell. Here we can enter a series of commands, and then the system will explain (if valid );

In the graphic interface, it may be difficult to cut the file copy (the system is not the root permission by default), so what should we do if we want to get the Administrator permission.

At this point we see a message like this: Fuqiang @ fuqiang-K43SJ :~ $ @ Indicates your current user, followed by the machine model. This is set by yourself when installing the system .~ Represents the root directory $ represents a common user;

Next, set the system administrator permission (the permission is high, and you can even kill yourself, so you don't know how to use it with caution ):

1. Get Root

Run the following command: (Linux is case sensitive. After entering S, you can press the tab key twice. A prompt or automatic completion is displayed)

Sudo passwd root // not password

Then you will be prompted to enter the current user's password, and then set the root user password, and re-enter the confirmation;

After setting, we enter:

su root

At this point, the display is: root @ fuqiang-K43SJ:/home/Fuqiang # Note, into # number, that is, the current user is the system administrator;

Then switch back:

Su name // (your user name)

2. Enter Cal to display the calendar

Cal // display the current year, month, and day (marked in Reversed colors for daily use) Cal 2013 // display the calendar for the year of 2013 Cal 8 2013 // display the calendar for the year of August 2013

3. Date display time:

Date // current time zone time date-u // UTC time zone time date -- UTC // same as above

4. Shutdown and restart:

Enter who:

List all users using the system, terminal names used, and the time when the system was registered

Sudo init 0 // shut down sudo init 6 // restart

Different runtime levels are defined as follows:

#0-Shutdown
#1-single-user mode
#2-multiple users without NFS
#3-full multi-user mode (Standard Operation Level)

#4-useless

#5-X11 (XWindow)

#6-Restart

You can also use shutdown.

Sudo shutdown now // shut down sudo shutdown immediately-H 60 // shut down after 60 minutes; sudo shutdown-C // cancel the shutdown schedule

You can also enter:

Shutdown -- help // (two -)

Make good use of -- help is a dictionary !~


Simple command: 1. Echo command:

echo hello word!

Helloword will be displayed!

2. Clear command

The screen should be full at this time. Use the following command:

clear

Clean up;

3. passwd command:

Set the user password, for example:

passwd fuqiang

You can change the user password;

Sleepy... continue tomorrow...

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.