Linux Basic Command operations

Source: Internet
Author: User

I. Linux terminal introduction shell prompt Bash Shell basic Syntax

TTY view currently logged in information

1.1 Communication between different terminals

[[email protected] ~]# TTY
/dev/pts/1

[Email protected] ~]# echo "Hellow" >/DEV/PTS/1

1.2 Broadcast on all terminals, shutdown after 10 minutes

Method One:

[Email protected] ~]# shutdown +ten-c #取消关机

Method Two:

" I'll shutdown in ten MINUTES-LH "   from [email protected] (pts/1) (Fri  2at:59  2018inten MINUTES-LH
1.3 Shell

Shell commonly known as Shell, it provides a user interface to interact with the kernel, it receives the user input commands and sends it into the kernel to execute

Shell is actually a command interpreter that executes by interpreting the command entered by the user and transmitting it to the system kernel.

Shell has its own programming language for editing commands, which allows the user to write programs composed of Shell commands. Shell programming languages have many features of a common programming language, such as a looping structure and branching control structures, and shell programs written in this programming language have the same effect as other applications.

Viewing the system's shell, usually using bash (other introduction:)

[Email protected]/root]$more/etc//bin/sh/bin/bash/sbin/nologin/usr/bin/ sh/usr/bin/bash/usr/sbin/nologin/bin/tcsh//c style enhanced /bin/csh            //c Style

View the currently used shell

[[email protected] ~]# Head  -1 /etc/passwdroot:x:0:0: root:/root:/ Bin/bash
Second, basic Operation command 2.1 ls
LS-l   -a   -D   View the directory without viewing the contents
Ls-s Sort=size

The first character file type:

D : Catalog File

L : Link File

b : Block device Files

C : Character device files

P : Pipeline File

-: represents a normal file

Color

for content

example

Blue

Contents

/etc

Black

file

/etc/passwd

light blue

link

/etc/grub2.cfg

Red

Compressed package

boot.tar.gz

Green

executable

td>

/etc/init.d/network

Black yellow word

Device file

/dev/sda

2.2 Alias Aliases

Type ll can see that LL is the alias of Ls-l--colore=auto

2.2.1 Temporary aliases

1. Define aliases-system restart will expire

[[email protected] ~]# alias vimens33="vim/etc/sysconfig/network-scripts/ifcfg-ens33"

2. Using aliases

Vimens33

3. Remove aliases

Unalias Vimens33

2.2.2 Permanent aliases

Linux Basic Command operations

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.