Linux基本命令简介

一命令提示符号

[root@localhost ~]#
root:代表登录用户
localhost:主机名
~:当前所在目录(家目录
#:超级用户提示符
$:普通用户提示符
 
二 命令格式
命令 [选项] [参数]
注意:
1、个别命令使用不遵循此格式。
2、当有多个选项时,可以写在一起。
3、简化选项与完整选项,选项是用来调整命令功能。
-a 等于 --all
 
三 查询目录中的内容:ls
ls [选项] [文件或目录]
选项:
-a:显示所有的文件,包括隐藏文件
-l:显示详细信息
-d:查看目录属性
-h:个性化显示文件大小
-i:显示inode
 
四 文件权限介绍


 
 
五 Linux文件类型
普通文件,目录文件、链接文件,块设备文件,字符设备文件,套接字文件和管道文件。
 
六 实战
  1. [root@localhost ~]# ls
  2. anaconda-ks.cfg gobin Music
  3. ChangeLog-2.6.0 goc2p Pictures
  4. Desktop golib Public
  5. Documents goproject Templates
  6. Downloads initial-setup-ks.cfg Videos
  7. go1.8.3.linux-amd64.tar.gz linux-2.6.39.tar.bz2
  8. [root@localhost ~]# ls -l
  9. total 89300
  10. -rw-------.1 root root 1579Oct262016 anaconda-ks.cfg
  11. -rw-r--r--.1 root root 12777Dec182003ChangeLog-2.6.0
  12. drwxr-xr-x.2 root root 6Oct282016Desktop
  13. drwxr-xr-x.2 root root 6Oct282016Documents
  14. drwxr-xr-x.2 root root 6Oct282016Downloads
  15. -rw-r--r--.1 root root 90029041Jul815:13 go1.8.3.linux-amd64.tar.gz
  16. drwxr-xr-x.2 root root 15Jul819:26 gobin
  17. drwxr-xr-x.6 root root 4096Jul818:11 goc2p
  18. drwxr-xr-x.4 root root 26Jul819:46 golib
  19. drwxr-xr-x.2 root root 6Jul818:10 goproject
  20. -rw-------.1 root root 1627Oct262016 initial-setup-ks.cfg
  21. -rw-r--r--.1 root root 1383989Nov122016 linux-2.6.39.tar.bz2
  22. drwxr-xr-x.2 root root 6Oct282016Music
  23. drwxr-xr-x.2 root root 6Oct282016Pictures
  24. drwxr-xr-x.2 root root 6Oct282016Public
  25. drwxr-xr-x.2 root root 6Oct282016Templates
  26. drwxr-xr-x.2 root root 6Oct282016Videos
  27. [root@localhost ~]# ls -l /etc/
  28. total 1432
  29. drwxr-xr-x.3 root root 97Oct262016 abrt
  30. -rw-r--r--.1 root root 16Oct262016 adjtime
  31. -rw-r--r--.1 root root 1518Jun72013 aliases
  32. -rw-r--r--.1 root root 12288Oct262016 aliases.db
  33. drwxr-xr-x.2 root root 49Oct262016 alsa
  34. drwxr-xr-x.2 root root 4096Nov122016 alternatives
  35. -rw-------.1 root root 541Jul272015 anacrontab
  36. -rw-r--r--.1 root root 55Mar62015 asound.conf
  37. -rw-r--r--.1 root root 1Nov202015 at.deny
  38. drwxr-xr-x.2 root root 20Oct262016 xml
  39. drwxr-xr-x.6 root root 4096Oct262016 yum
  40. -rw-r--r--.1 root root 970Dec32015 yum.conf
  41. drwxr-xr-x.2 root root 4096Dec32015 yum.repos.d
  42. [root@localhost ~]# ls /dev/
  43. autofs mqueue stdout tty35 tty63
  44. block net tty tty36 tty7
  45. bsg network_latency tty0 tty37 tty8
  46. btrfs-control network_throughput tty1 tty38 tty9
  47. bus null tty10 tty39 ttyS0
  48. cdrom nvram tty11 tty4 ttyS1
  49. char oldmem tty12 tty40 ttyS2
  50. console port tty13 tty41 ttyS3
  51. core ppp tty14 tty42 uhid
  52. cpu ptmx tty15 tty43 uinput
  53. cpu_dma_latency pts tty16 tty44 urandom
  54. crash random tty17 tty45 usbmon0
  55. disk raw tty18 tty46 usbmon1
  56. fd rtc tty19 tty47 vcs
  57. full rtc0 tty2 tty48 vcs1
  58. fuse sda tty20 tty49 vcs2
  59. hidraw0 sda1 tty21 tty5 vcs3
  60. hpet sda2 tty22 tty50 vcs4
  61. hugepages sda3 tty23 tty51 vcs5
  62. initctl sda4 tty24 tty52 vcs6
  63. input sda5 tty25 tty53 vcsa
  64. kmsg sda6 tty26 tty54 vcsa1
  65. log sda7 tty27 tty55 vcsa2
  66. loop-control sg0 tty28 tty56 vcsa3
  67. lp0 sg1 tty29 tty57 vcsa4
  68. lp1 shm tty3 tty58 vcsa5
  69. lp2 snapshot tty30 tty59 vcsa6
  70. lp3 snd tty31 tty6 vfio
  71. mapper sr0 tty32 tty60 vga_arbiter
  72. mcelog stderr tty33 tty61 vhost-net
  73. mem stdin tty34 tty62 zero
  74. [root@localhost ~]# ls -lh
  75. total 88M
  76. -rw-------.1 root root 1.6KOct262016 anaconda-ks.cfg
  77. -rw-r--r--.1 root root 13KDec182003ChangeLog-2.6.0
  78. drwxr-xr-x.2 root root 6Oct282016Desktop
  79. drwxr-xr-x.2 root root 6Oct282016Documents
  80. drwxr-xr-x.2 root root 6Oct282016Downloads
  81. -rw-r--r--.1 root root 86MJul815:13 go1.8.3.linux-amd64.tar.gz
  82. drwxr-xr-x.2 root root 15Jul819:26 gobin
  83. drwxr-xr-x.6 root root 4.0KJul818:11 goc2p
  84. drwxr-xr-x.4 root root 26Jul819:46 golib
  85. drwxr-xr-x.2 root root 6Jul818:10 goproject
  86. -rw-------.1 root root 1.6KOct262016 initial-setup-ks.cfg
  87. -rw-r--r--.1 root root 1.4MNov122016 linux-2.6.39.tar.bz2
  88. drwxr-xr-x.2 root root 6Oct282016Music
  89. drwxr-xr-x.2 root root 6Oct282016Pictures
  90. drwxr-xr-x.2 root root 6Oct282016Public
  91. drwxr-xr-x.2 root root 6Oct282016Templates
  92. drwxr-xr-x.2 root root 6Oct282016Videos
  93. [root@localhost ~]# ls -lh go1.8.3.linux-amd64.tar.gz
  94. -rw-r--r--.1 root root 86MJul815:13 go1.8.3.linux-amd64.tar.gz
  95. [root@localhost ~]# ls -a
  96. .Desktop initial-setup-ks.cfg
  97. ..Documents linux-2.6.39.tar.bz2
  98. anaconda-ks.cfg Downloads.local
  99. .bash_history .elinks .mozilla
  100. .bash_logout .esd_auth Music
  101. .bash_profile go1.8.3.linux-amd64.tar.gz Pictures
  102. .bashrc gobin .pki
  103. .cache goc2p Public
  104. ChangeLog-2.6.0 golib .tcshrc
  105. .config goproject Templates
  106. .cshrc .ICEauthorityVideos
  107. [root@localhost ~]# ls -ld /etc/
  108. drwxr-xr-x.130 root root 8192Jul1021:08/etc/
  109. [root@localhost ~]# ls -i
  110. 33559702 anaconda-ks.cfg 100738328 goproject
  111. 33559705ChangeLog-2.6.033559704 initial-setup-ks.cfg
  112. 33575838Desktop33559703 linux-2.6.39.tar.bz2
  113. 33575846Documents67163627Music
  114. 67163626Downloads100691831Pictures
  115. 33559706 go1.8.3.linux-amd64.tar.gz 327Public
  116. 33576732 gobin 100691824Templates
  117. 371 goc2p 328Videos
  118. 67161955 golib

猜你喜欢

转载自cakin24.iteye.com/blog/2391207