Linux operations sixth----Linux commands and Linux Essentials optimization

Source: Internet
Author: User

First, replace the file
1. Op.txt is known to exist in the/root/data, how to copy the/root/afeng/op.txt to the data directory and replace
2.1[[email protected]/]# \cp/root/afeng/op.txt/root/data/
2.2[[email protected] ~]#/bin/cp/root/data/op.txt/root/afeng/
Second, VIM's shortcut keys
G reach the bottom
GG arrives on the first floor
O Go to the downstream editor
U undo
: Wq Save and exit
: q! Forced exit
Third, set the alias
1. Why alias is set
Safety: To enter a crowbar when using dangerous commands
2. The first step
[[email protected] ~]# alias MN
-bash:alias:mn:not found
3.[[email protected] ~]# alias mn= ' Command (example: Echo mn Lada) '
[[email protected] ~]# alias mn= ' echo mn Lada '
[Email protected] ~]# MN
MN Lada
4. Step Two
[Email protected] ~]# Vim/etc/profile
Press GG to the lowest level


Press O to go to the next line to edit

Press ESC to exit edit mode, enter save to exit
5. Entry into force, inspection

Check:

Iv. Replacement of file contents
1. Command find+ pipe +sed
[Email protected] ~]# find/data/-type f-name ' *.txt ' |xargs sed-i ' s#hs#wbd#g '
V. Basic Linux optimization
1. Display System version information
[Email protected] ~]# cat/etc/redhat-release
[Email protected] ~]# uname-r
[Email protected] ~]# uname-m
2. Add user set password switch user
Add User: Useradd Oldboy
Password Setting a password
[email protected] ~] #passwd Oldboy
New Password:
Retype new Password: (Input two times)
Show Passwd:all authentication tokens updated successfully. And for success
3. Switch users:
Su-oldboy
CTRL + D (exiting the current user)

Linux operations sixth----Linux commands and Linux Essentials optimization

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.