Basic Learning for Linux (RedHat)-Getting Started with command line

Source: Internet
Author: User

1.linux
严格来讲,linux这个词只表示linux内核。我们口语中平常所说的Linux是基于linux内核并且使用GNU工程各种工具和数据库的操作系统。
2.shell
1.shell是命令解析器。在计算机科学中,Shell俗称壳(用来区别于核),是指“提供使用者使用界面”的软件(命令解析器)。它类似于DOS下的cmd.exe。它接收用户命令,然后调用相应的应用程序。2.shell可以保护系统内核不被篡改的软件。3.shell分图形界面shell和命令行式shell。


PS: Learning is one of the Linux distributions Redhat,shell with bash

Open a bash in the following ways:

1.Applications->Utilities->Terminal2.鼠标右键---->open in Terminal3.gnome-terminal4.Ctrl+shift+n      再已有bash的基础上再打开一个bash。此方式要在桌面已经建立一个bash的前提下,并且保证鼠标在该bash中才可以成功打开,否则是新建文件夹5.Ctrl+shift+t       在同一个bash窗口打开一个新的tab,保证鼠标在该bash中才能成功打开

A bash:

There are two tabs in a bash;

Exit Method:

exitCtrl+d
Virtual machine Operations

PS; Redhat used in learning has installed two virtual machines dektop and servers
Operation Command:

rht-vmctl start desktop/server              开启虚拟机desktop/serverrht-vmctl view desktop/server              将虚拟机开启图形模式rht-vmctl restart desktop/server           重启虚拟机rht-vmctl reset desktop/server              重置虚拟机
3. How to execute commands in the shell

1. The command must be entered after the line prompt.

2. How the line prompt is occupied, then CTRL + C can end the program that occupies the current line prompt (the interrupt program) to release the line prompt.

3. Command + space + parameter + Space + object

命令就是程序参数就是程序指定的某种功能   -a -b -c =-abc = -bac对象就是操作的目标

4. Shortcut keys

Ctrl + a   切换到命令行开始 Ctrl + e   切换到命令行末尾 Ctrl + l    清除屏幕内容 Ctrl + u   清除剪切光标之前的内容 Ctrl + k   剪切清除光标之后的内容 Ctrl + y   复制剪切板里的内容 Ctrl + h   类似于退格键 Ctrl + r    在历史命令中查找 (这个非常好用,输入关键字就调出以前的命令了) Ctrl + c   终止命令 Ctrl + d   退出shell Ctrl + z   转入后台运行..  Alt + f     切换光标前的字母 Alt + b    切换光标后的字母

5. What the line prompt means
[Email protected] desktop]$

kiosk:表示shell的运行人是谁(当前用户身份)foundation0 :shell开启主机的主机名称Desktop:你当前所在文件夹(目录)的名字$:当前用户身份级别,‘#‘表示超级用户,‘$‘表示普通用户

Switch identities:

su -                             输入密码后切换到超级用户root身份su - username          切换到username用户超级用户切换到任意用户不需要密码,切换到超级用户需要密码

6. System restart, shutdown
Restart

reboot或init 6或shutdown -r now

Shutdown

poweroff或init 0或shutdown -h now

About the TAB key

在系统中table键可以自动补齐存在的命令,文件名称和某些命令的参数a+TAB x2  显示系统中所有a开有的命令(a+tab连按2次)

############################

How to get help in the system

############################

1. When we get an order, we don't know what this command does.

whatis 命令whatis cal:显示cal命令的用途cal (1)              - display a calendarcal (1p)            - print a calendar

Whatis passwd

2. When you know the purpose of the command, but do not know the format or method of the command

命令  --help:获得命令的帮助 --help只适用于命令cal --helpuseage:cal [options] [ [ [day] month] year][选加]                 可以加也可以不加...                        加的个数可以时任意多个<必须加>          不可缺少的信息

3. See where the command files are located

which + 命令

When we look at the file help,--help is not available, then we need to use the Man (manual) command to see the help

Man's Level:

1 命令2 内核调用的接口3 函数库4 特殊文件比如设备文件5 系统文件6 游戏7 包信息8 系统密令9 内核规则man date:查看date命令的帮助手册man 5 passwd:查看/etc/passwd 文件的帮助手册

After entering the man page:

pageup:向上翻页pagedown:向下翻页/关键字:查找关键字n:关键字向下匹配N:关键字向上匹配q:退出

"Note: When the man or Whatis command fails to query for help, it is because the system does not load the Help database"

"Processing mode: Executing MANDB"

Basic Learning for Linux (RedHat)-Getting Started with command line

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.