Basic operation of Linux

Source: Internet
Author: User

1、Linux系统更多的是在命令行下面进行管理与配置。 2、Linux有两种登录模式(纯文本登录环境,图形桌面的登陆方式) 3、Linux默认有6个虚拟终端来让用户登录(tty1~tty6按ctrl+alt+f(1~6)命令来切换)F1图形界面,F2~F6字符界面 4、hostname查看当前的主机的完整名称hostname:xx临时修改主机名,logout,exit退出登录 5、永久的修改主机号 vi /etc/hostname 按i进入输入模式,修改 完主机号按Esc退出输入模式,在按shift+:在输入wq,回车即可 修改完,重启生效init 6重启 6、pwd显示用户当前显示工作目录位置 7、cd 用于切换工作目录 8、绝对路径: 以根目录"/"作为起点 相对路径:以当前工作目录作为起点,在开头不使用"/"符号形式有 a:直接使用目录名:用于表示当前工作目录中的子目录的位置 b:使用两个点号".."开头,表示以当前目录的上一级目录(父目录)作为起点; c:使用一个点号"."开头,当前的工作目录作为起点 cd 或者~ 回到起初家目录 cd -切换回上一次执行cd命令之前所处的目录 cd ..返回上一层目录 ./当前目录 ../上级目录的路径 ~回到/root目录 ls显示目录文件夹中的内容 9、$PS1(提示符变量)有$变量 echo打印输出 10、查看发行版本 cat /etc/redhat-release centos7查看发行版本 查看操作系统:uname 查看内核版本:uname -r 查看IP地址:ifconfig 产看CPU信息:cat /proc/cpuinfo 查看内存信息:cat /proc/meminfo 查看硬盘信息:df -h 11、关机操作 shutdown -h now poweroff init 0 延迟关机 shutdown -h +分钟 "提示内容" 例子:shutdown -h 5 "guanji" 取消:ctrl+c 重启操作: shutdown -r now reboot init 6 shutdown -r +分钟 "提示内容" ctrl+c;shutdown -c 退出当前操作环境:exit

Basic operation of Linux

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.