1. linux 基础命令

who, which, basename, dirname, echo, type, hash, whatis, makewhatis, man, info, help, ls, cd,pwd, mkdir, rmdir, touch, rm, date, hwcolck, cal, shutdown, reboot, tty

1 who : Show who is logged on, print information about users who are currently logged in.

  显示登录的用户。

2 which : Show the full path of (shell) commands

  which pwd, which shutdown

3 basename : Print name with any leading directory components removed.

  basename /usr/bin/sort , Output: sort

4 dirname : strip non-directory suffix from file name

  dirname /usr/bin/sort , Output: /usr/bin

5 命令替换

  ‘ ’ :强引用,变量不会替换;

  “ ” :若引用,变量可以替换;

  ` ` :命令应用,类似$()

6 echo : display a line of text , 回显

  echo $PATH , Output: /usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

  echo '$PATH' , Output: $PATH

  echo "zhu biao" , Output: zhu biao

  echo `date +%F`(echo $(date +%F)) , Output: 2016-10-26

7 type : Display information about command type

  type cd , Output: cd is a shell builtin

  type shutdown , Output: shutdown is /sbin/shutdown, 若shutdown已经执行过,将会添加到hash数据库,则:shutdown is hashed (/sbin/shutdown)

8 hash : Rember or display program loacations, 显示hash数据库,执行过的程序次数、位置。

9 whatis : 简洁描述某个命令的功能,该命令在manual文档中的章节

  whatis shutdown , Output:

            shutdown    (2)  - shut down part of a full-duplex connection
            shutdown    (3p)  - shut down socket send and receive operations
            shutdown    (8)  - bring the system down

10 makewhatis : Create the whatis datebase

11 shell command 分为内部命令和外部命令

  内部命令帮助:help command

  外部命令帮助:command --help, man command, info command

12 man : man [section] command , manual , 命令,配置文件格式,库调用等帮助文档

  [section]:

  1: User Commands
     2: System Calls
     3: C Library Functions
     4: Devices and Special Files
     5: File Formats and Conventions
     6: Games et. Al.
     7: Miscellanea
     8: System Administrations tools and Deamons

13 info : 获取在线帮助文档,使用方法类似man

14 help : shell内部命令帮助文档

  help ls

15 {a,b} : 可展开

  {a,b}/{x,y} : a/x a/y b/x b/y

  {a,b}-heburn-{x,y} : a-heburn-x a-heburn-y b-heburn-x b-heburn-y

16 ls : list directory contents

  ls /home/zhubiao

17 cd : change the shell working directory

  cd /home/zhubiao

  cd ~ : 回到用户家目录

  cd ~zhubiao : 回到用户zhubiao家目录

  cd - : 回到上一个目录

18 pwd : Print working directory

19 mkdir : make directories

  Create directories /mnt/linux/bin, /mnt/linux/sbin, /mnt/bin, /mnt/sbin 可用如下命令:

  mkdir -pv /mnt{/linux/{bin/sbin},bin,sbin}

20 rmdir : remove empty diretories

  rmdir /mnt

  rmdir -p /a/b

21 rm : remove files or directories

  rm -rf /a/b/zhubiao

22 touch : 创建文件

23 date : print or set the system date and time

  date [MMDDhhmm[[CC]YY][.ss] :

    date 10262318 设定系统时间为10月26日 23:18,

    date 102623182016.33 设定系统时间为 2016-10-26 23:18:33

    date +%F , Output: 2016-10-26

    date +%T , Output: 23:18:33

    -s : --set "CCYY-MM-DD hh:mm:ss"

24 hwclock : query or set the hadway clock (RTC)

  hwclock --set --date="2016-10-10 23:12:10"

  hwclock -s(--hctosys)

  hwclock -w(--systohc)

25 cal : Display a calendar

  cal , Output:

      October 2016   
      Su Mo Tu We Th Fr Sa
                         1
       2  3  4  5  6  7  8
       9 10 11 12 13 14 15
      16 17 18 19 20 21 22
      23 24 25 26 27 28 29
      30 31

26 shutdown : bring the system down

  shutdown -h now

  shutdown -r +5

27 reboot : reboot, halt, poweroff - reboot or stop the system

28 ternial

  a.虚拟终端 tty#

  b.物理终端 console

  c.伪终端 pts/#

  

一. Linux 常用命令总结的更多相关文章

  1. Linux常用命令(一)

    Linux常用命令 1. pwd查看当前路径(Print Working Directory)    [root@CentOS ~]# pwd/root 2. cd .. 返回上一级 .. 表示上一级 ...

  2. linux常用命令的介绍

    本文主要介绍Linux常用命令工具,比如用户创建,删除,文件管理,常见的网络命令等 如何创建账号: 1. 创建用户 useradd -m username -m 表示会在/home 路径下添加创建用户 ...

  3. linux——常用命令与脚本

    linux常用命令 --文件管理pwd --查看当前目录cd --切换当前目录ls --列出当前目录下的所有文件touch --创建文件mkdir --建立目录rmdir --删除空目录rm --删除 ...

  4. DOS 和 Linux 常用命令的对比

    DOS 和 Linux 常用命令的对比 许多在 shell 提示下键入的 Linux命令都与你在 DOS 下键入的命令相似.事实上,某些命令完全相同. 本附录提供了 Windows的 DOS 提示下的 ...

  5. 第一章,Linux常用命令

    20161124 Linux常用命令1.find find /etc/ -size +50k -lsfind /etc/ -size +50k -ls 2> /dev/null查看目录下大于50 ...

  6. linux 常用命令大全

    linux 常用命令大全 系统信息 arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统 ...

  7. Linux 常用命令行

    Linux常用命令行 第一部分: cd命令 第二部分:文件操作 第三部分:压缩包操作

  8. [工作需求]linux常用命令以及vim常用命令

    一.             Linux 常用命令 mkdir dirname新建文件夹 cd ~ 进入自己的家目录 cd dirname 进入名字为dirname的目录: l 显示当前文件夹下的文件 ...

  9. 对于我的linux常用命令的说明

    我所列出的linux常用命令中的选项并不是全部的选项,是一些我们经常用到的linux命令及选项

  10. Linux 常用命令笔记

    Linux 常用命令笔记 1. locate locate:用来定位文件的位置,如:locate a.txt 但是这个命令有延迟,也就是新建的文件不一定能搜索到,如果非要找到新建的文件可以使用 upd ...

随机推荐

  1. Winform基础

    1.显示窗口的两种方式: 非模态(Modaless):Show 模态(Modal),阻塞主窗口:ShowDialog() 2.主窗口和对话框之间传递参数,在对话框中申明属性,主窗口给对话框传递值通过参 ...

  2. C#递归题目代码

    一列数的规则如下: 1.1.2.3.5.8.13.21.34...... 求第30位数是多少, 用递归算法实现. 代码: public class MainClass { public static ...

  3. asp.net 网页抓取内容

    网页抓取代码 using System; using System.Collections.Generic; using System.Linq; using System.Web; // using ...

  4. C# 实现WinForm窗口最小化到系统托盘代码,并且判断左右鼠标的事件

    1.设置WinForm窗体属性showinTask=false 2.加notifyicon控件notifyIcon1,为控件notifyIcon1的属性Icon添加一个icon图标. 3.添加窗体最小 ...

  5. macbook 我们需要买吗

    能否写出好代码与是否使用“好”的电脑是没有直接关系的.

  6. 当kfreebsd 用户遇见openSUSE系统

    openSuse的系统工具集覆盖了四大主流桌面环境,是针对每一种桌面环境定制的独立的桌面体验.

  7. yii2.0 图片上传(摘录)

    文章来源:http://blog.sina.com.cn/s/blog_88a65c1b0101izmn.html 下面小伙就带领大学学习一下 Yii2.0 的图片上传类的使用,还是老样子,如果代码样 ...

  8. SystemClock.sleep和Thread.sleep的区别(转)

    在Java中我们处理线程同步问题时,处理延迟可能会使用Thread类的sleep方法,这里抛开concurrent类的一些方法,其实 Android平台还提供了一个SystemClock.sleep方 ...

  9. CentOS下apache绑定域名

    本文主要介绍在CentOS下apache绑定域名以及apache绑定多个域名,首先要找到apache的配置文件httpd.conf的位置.CentOS操作系统一般在 /etc/httpd/conf 下 ...

  10. Emmet插件比较实用常用的写法

    看了一些关于Emmet插件写法的文档,港真,怎么可以写这么长啊.其实知道几个大概要点加上实践基本就能上手写了啊 杂话 我前面有一篇[今天发现新大陆:haml和Emmet ],其实一开始的想法是写给自己 ...