Fundamentals of Linux Basic operations __linux

Source: Internet
Author: User

We may not be able to adapt to the beginner or just contact with Linux, perhaps because we are exposed to more graphical interface operation, more typical time window operating system, learning Linux we have to learn to use the command line operation and machine dialogue. Just contact with a new thing when we do not fear, to hold a curious mentality, as long as the mentality of the positive, we learn efficiency will be more effective.

The operating system is the user and the machine interaction medium, is also a tool, we only then is familiar with the tool the disposition, can better with it. Users can enter commands through the user interface of the operating system. The operating system interprets commands, drives hardware devices, and implements user requirements. Its main content is process management, memory management, file system, network communication, security mechanism, user interface, driver and so on.

It is recommended that you start with a virtual machine when you are learning Linux, and you can recover quickly if we manipulate some files incorrectly.

After configuring the virtual, I do not have any of the virtual operations. Open, close, reset, etc

################ #虚拟机控制 ##############
[Kiosk@foundation0 desktop]$ rht-vmctl start Desktop # # #开启desktop虚拟机
Error:desktop not started (is already running) # # #报错, desktop already running
[Kiosk@foundation0 desktop]$ Rht-vmctl View Desktop # # #显示desktop
[Kiosk@foundation0 desktop]$ Rht-vmctl poweroff Desktop # # #关闭dekstop
Powering off desktop.
[Kiosk@foundation0 desktop]$ rht-vmctl start Desktop # # #开启desktop
Starting desktop.
[Kiosk@foundation0 desktop]$ rht-vmctl View Desktop
[Kiosk@foundation0 desktop]$ rht-vmctl Poweroff Desktop
Powering off desktop.
[Kiosk@foundation0 desktop]$ rht-vmctl View Desktop
Error:unable to view Desktop-not currently running. # # #虚拟机没开启无法显示
[Kiosk@foundation0 desktop]$ Rht-vmctl Reset Desktop # # #当虚拟机出现故障, reset means reset
Are you sure your want to reset desktop? (y/n) y # # #询问是否重置y表示yes
Resetting desktop. # #正在重置
Powering off desktop.

When the interface is open, the system reflects our eyes are ordinary users, for security reasons, the super user is hidden,
Linux is a multi-user multi-threaded operating system, so it is necessary to switch users.
Advanced users switch to low-level users do not require a password, low-level users to switch to advanced or peer switching requires a password
Command switching is mainly in the SU command. Format is Su-user
[# # @found desktop]$ su-username
The user's login has a shell and a non-login shell at logon, distinguishing whether a login password is required.

######## #进入系统 ##################
*) Common User Login
Student Common user, password student

*) Super User Login
->not listed Click Not listed
Username prompt to enter user name
->root root for System Superuser
passwd Prompt to enter password

->redhat Redhat is a super user password



Language adjustment with input language adjustment and environment language adjustment
# # #语言调整 #####
Applications----->system Tools---->settings----->region & Language--->language
The language adjustment of the environment is at the top, the input language adjustment is below

Open command line---> reboot
Reboot required to take effect


# # #1. Line Prompt ######
[Kiosk@foundation0 desktop]$
Kiosk # #打开shell的用户
@ # #分隔符
Foundation0 # #主机名称
Desktop # #工作目录名称
$ # #身份提示符, #表示超级用户, $ for ordinary users

Note: The command must be entered at a prompt to perform




# # #命令的执行 # #
1. Commands must be entered at the prompt after the
2. Command format
Command parameter target
3.ctrl +c # #撤销命名的执行
4. Command parameters
-Parameter # #单词缩写
--Parameter # #单词的全拼


###### #命令的帮助 # #

Learn to use help so that we can learn any technology to learn, to teach the fishing.

1.
Whatis Command # #查看命令的功能
Command--help # #查看命令的帮助
[] # #选择加入的内容, can be added without
.. # #加入的内容个数任意
<> # #内容在命令执行过程当中必须要加

Man command to get command use Help



#####. The basic method of system usage ######
1) System Login
Graphics Landing Mode
Text Landing mode
Gnome-session-quit--force # # #注销用户--force Force logoff, do not ask

2) Working interface conversion
ctrl+alt+ on |

3) Start bash
1.applications>utilities>terminal
2. Right mouse button----->open in terminal
3.gnome-terminal
4.ctrl+shift+n # #在新窗口中打开shell
Ctrl+shift+t # #同一个窗口中打开新的tab
5. Exit: Exit | Ctrl+d


4 system shutdown, reboot
Reboot
Reboot | Init 6 |shutdown-r Now
Shutdown
Poweroff | Init 0 | Shutdown-h now

Init is one of the most indispensable programs in Linux system operations. Its correct position is/sbin/init. If the kernel cannot find Init, it will try to run/bin/sh, and if the operation fails, the system will fail to start.
Linux has seven user modes Init0-init6
Init 0: Stop the system from running. Init 0〈 carriage return is equivalent to Halt〈 carriage return.
INIT6: Reboot the system. Init 6〈 carriage return is equivalent to Reboot〈 carriage return.
### #3. Virtual Console #####
Ctrl+alt+f (1|7) into the graphics
Ctrl+alt+f (2~6) into the Virtual Console

Red hat Enterprise Linux Server 7.0 (Maipo) # #系统版本
Kernel 3.10.0-123.el7.x86_64 on a x86_64 # #内核版本, number of system digits

Desktop0 Login:root # #登陆用户名称输入
Password: # #密码输入无回显

5) Lock Screen
CTRL + Alt +l # #在rhel7.0
Win key + L # #在rhel7 2

# # #简单的系统命令
1) Date
Watch-n 1 Date # # #让date命令每秒执行一次, CTRL +C launch monitoring mode

Date 11181115 # # #把系统时间设定为11月18日11:15 format: Months every day hour minutes
Date 111811152016.55 # #2016表示年 (can not be added). 55 for seconds (can not be added)

-D +xday-xday # #查看x天前或者后的时间
+%. # #设定date的输出格式

Hwclock has two kinds of clocks, such as hardware clock and system clock in Linux. Display and set the hardware clock.

Hwclock-w the system time to the hardware time

Hwclock-s to write the system time to the software time

The hardware time is displayed by default.



2) passwd
1.PASSWD Modify User Password
[Root@foundation0 ~]# passwd

Changing password for user root. # #改变超级用户密码
New Password: # #输入密码
Bad Password:the PASSWORD is shorter than 8 characters
Retype new password: # #确认密码
Passwd:all authentication tokens updated successfully.


[Kiosk@foundation0 desktop]$ passwd
Changing password for user kiosk. # #改变普通用户密码
changing password for kiosk.
(current) UNIX Password: # #输入当前密码
New Password:
Bad Password:the PASSWORD are the same as the old one # #和原始密码不能相似
New Password:
Bad password:the PASSWORD fails the dictionary check-it is too simplistic/systematic # #密码必须是无序数字 + Letter
New Password:
Bad Password:the PASSWORD is shorter than 8 characters # #密码必须 >8 bit

passwd parameter User name
-S student # #用户密码信息
--status student ...
-L Student # #锁定帐号
-U student # #解锁
-N 1 Student # #设定密码最短有效期
X Student # #设定密码最长有效期
-W 3 Student # #警告期
-I 2 student # #设定用户非活跃天数
-D Student # #清除用户密码
Monitor passwd password information
Watch-n 1 passwd-s Student


3) file
File name # #查看文件类型

4 View of the file
Cat filename # #显示文件的全部内容
Less file # #分页浏览, press ' Q ' to exit
Head FileName # #显示一个文件的前几行
Head-n 5 FileName # #前五行
Tail filename # #显示文件后几行
Tail-n 5 FileName # #显示一个文件的后5行

5 WC statistic File capacity information
Wc-l Number of rows
-W Word
-C byte Count
-M character Count

# # # # #tab键 ######
In the System the table key can be automatically padded with existing commands, file names and some command parameters

A+tab x2 Display all commands in the system


### #history历史调用 ######
History # #显示历史
HOSTORY-C # #清除当前环境当中的历史命令
。 Number # #执行第多少行命令
。 Letter # #执行最近一条以这个字母开头的命令
Ctrl +r + keyword # #执行最近一条含有这个关键字的命令
Up and down key # #逐行调用命令


# # # # #linux中的快捷键 ######
Around # #一个字符一个字符移动
CTRL + Around # #一个字一个字移动
CTRL + A # #光标移动到行首
+ E # #光标移动到行尾
+ U # #光标所在位置删除到行首
+ k # #光标所在位置删除到行尾
+ r+ keyword # #调出最近一条含有关键字的命令
+ C # #撤销以输入的命令
+ D # #关闭当前环境
+ L # #清空屏幕
+ SHIFT + C # #复制
+ SHIFT + V # #粘贴
+ SHIFT + t # #在现有shell中重新打开一个table
+ SHIFT + N # #在shell中打开一个新的shell
+ SHIFT + Pageup|pagedown # #切换table
+ ALT + L # # Lock Screen
+ ALT + top | down # #切换工作界面
+ ALT + F1|f7 # #进入图形界面
+ ALT + F2-f6 # #进入虚拟控制台
Shortcut keys for Flip screen

Turn back a screen space that is blank

Flip a screen, B.

Turn back one line to Enter

Turn forward one line K




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.