Linux operation and maintenance of the way of the admin command list (more than a few)

Source: Internet
Author: User

Admin Basic Command List

Full command format: Command word-option parameter

#pwd #查看当前工作目录

#cd #切换进去

#ls #查看所有文件 (under current directory)

#cat #查看文本文件

#uname-R #列出内核版本

#cat/proc/meminfo #查看内存

#lscpu #查看cpu

#ifconfig #列出已激活的网卡连接信息

#poweroff #关机

#reboot #重起

#mkdir XXXX #创建目录

#touch XXXX #创建文本文档

#alias myls= ' ls-ld ' #创建别名
#unalias Myls #取消别名
#rm XXXX #删除
#mv #重名命, path-invariant movement
#cp #复制, copy

[[email protected] ~]# rht-vmctl Reset Server #重置虚拟机server
[Email protected] ~]# ssh-x [email protected] #真机访问server (can be set to alias)
--------------------------------------------------------------------------------------------------------------- -------
Case: Mount Operation
1) Connect disc/iso/rhel-server-7.2-x86_64-dvd.iso
[[email protected] ~]# mount/dev/cdrom/mnt//Mount device
Mount:/dev/sr0 write protection, will be mounted as read-only
2) Mount the disc to the/MNT directory and check the contents of the/MNT directory
[[email protected] ~]# ls/mnt//Access device content
3) Unmount the disc device and check the contents of the catalog again
[[email protected] ~]# Umount/mnt/dvd//Uninstall device
[[email protected] ~]# LS/MNT/DVD//Confirm result
--------------------------------------------------------------------------------------------------------------- -------
A case of a list of operations
[Email protected] ~]# ls/etc/re*.conf

[Email protected] ~]# Ls/dev/tty?
--------------------------------------------------------------------------------------------------------------- --------
Case: Network configuration
#nmcli con mod ' System eth0 ' ipv4.method manual ipv4.addresses
' 172.25.0.11/24 172.25.0.254 ' Connection.autoconnect Yes
Manually specifying a DNS server
#vim/etc/resolv.conf
NameServer 172.25.254.254
--------------------------------------------------------------------------------------------------------------- --------
case: Configuring the Yum repository
#vim/etc/yum.repos.d/rhel7.repo
[ABC]
Name=abc
Baseurl= Address
Enabled=1
Gpgcheck=0
#yum repolist View Yum
--------------------------------------------------------------------------------------------------------------- -------
case: Upgrading the kernel
1: Download the new kernel installation file
[Email protected] ~]# wget
-3.10.0-123.1.2.el7.x86_64.rpm
2: Install the new version kernel
[Email protected] ~]# RPM-IVH kernel-3.10.0-123.1.2.el7.x86_64.rpm
3: Confirm the new kernel version
[Email protected] ~]# uname-r

--------------------------------------------------------------------------------------------------------------- -------------

case: Find and copy

1. Confirm that the specified file can be found

[[email protected] ~]# Find/-user student-type F
2. Create a destination folder
[Email protected] ~]# Mkdir/root/findfiles
3. Copy the found files to the destination folder
[[email protected] ~]# Find/-user student-type f-exec cp-p {}/root/findfiles/\
4. Confirm the copy result
[Email protected] ~]# ls-lha/root/findfiles/
case: Finding and extracting
1) Use the grep command to find the specified keyword and save it to the specified file by redirecting the output:
[[email protected] ~]# grep ' seismic '/usr/share/dict/words >/root/wordlist
2) Confirm Extraction Results
[Email protected] ~]# cat/root/wordlist



This article is from the Linux OPS blog, so be sure to keep this source http://13401400.blog.51cto.com/13391400/1977049

Linux operation and maintenance of the way of the admin command list (more than a few)

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.