已阅读5页,还剩1页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Linux入门命令1.pwd显示当前目录 rootlocalhost # pwd/root2.cd切换目录1)先查看一下当前目录,然后用cd切换到“/”。rootlocalhost # pwd/rootrootlocalhost # cd /2)从根目录切换到/tmp文件夹,用ls查看文件夹内容rootlocalhost /# cd tmprootlocalhost tmp# lsa b file1.txt file2.txt file3.txt scim-bridge-0.3.0.lockfile-0localhost:0.03)进入文件夹b,cd .命令退出brootlocalhost tmp# cd brootlocalhost b# cd .rootlocalhost tmp# pwd/tmp4)从tmp用命令切换到用户tom的文件夹下rootlocalhost tmp# pwd/tmprootlocalhost tmp# cd tomrootlocalhost tom# pwd/home/tom5)mkdir创建多级目录aa/bb/cc,ls R 是递归显示所有目录 cd ./.是返回上一级目录的上一级,即从cc返回到aa目录rootlocalhost tom# mkdir p aa/bb/cc -rootlocalhost tmp# ls -R.:a aa b file1.txt file2.txt file3.txt scim-bridge-0.3.0.lockfile-0localhost:0.0./aa:bb./aa/bb:cc./aa/bb/cc:./b:rootlocalhost tmp# cd aa/bb/ccrootlocalhost cc# pwd/tmp/aa/bb/ccrootlocalhost cc# lsrootlocalhost cc# cd ./.rootlocalhost aa# pwd/tmp/aa 3ls查看命令1)ls a 查看所有文件(包含隐藏文件)rootlocalhost tmp# ls -a. . a aa b file1.txt file2.txt file3.txt scim-bridge-0.3.0.lockfile-0localhost:0.02)ls l = ll 长格式显示所有文件内容(包含隐藏文件)rootlocalhost tmp# ll总计 12-rw-r-r- 1 root root 0 08-31 15:31 adrwxr-xr-x 3 root root 4096 08-31 16:07 aadrwxr-xr-x 2 root root 4096 08-31 15:32 b-rw-r-r- 1 root root 0 08-31 15:30 file1.txt-rw-r-r- 1 root root 0 08-31 15:29 file2.txt-rw-r-r- 1 root root 0 08-31 15:29 file3.txt-rw-r-r- 1 root root 5 08-31 16:17 scim-bridge-0.3.0.lockfile-0localhost:0.03)ls l(同上)rootlocalhost tmp# ls -l总计 12-rw-r-r- 1 root root 0 08-31 15:31 adrwxr-xr-x 3 root root 4096 08-31 16:07 aadrwxr-xr-x 2 root root 4096 08-31 15:32 b-rw-r-r- 1 root root 0 08-31 15:30 file1.txt-rw-r-r- 1 root root 0 08-31 15:29 file2.txt-rw-r-r- 1 root root 0 08-31 15:29 file3.txt-rw-r-r- 1 root root 5 08-31 16:17 scim-bridge-0.3.0.lockfile-0localhost:0.04)ls ld长格式显示目录rootlocalhost tmp# ls -lddrwxrwxrwt 4 root root 4096 08-31 16:07 .5)ls l h 的组合,以字节为单位显示信息rootlocalhost tmp# ls -lh总计 12K-rw-r-r- 1 root root 0 08-31 15:31 adrwxr-xr-x 3 root root 4.0K 08-31 16:07 aadrwxr-xr-x 2 root root 4.0K 08-31 15:32 b-rw-r-r- 1 root root 0 08-31 15:30 file1.txt-rw-r-r- 1 root root 0 08-31 15:29 file2.txt-rw-r-r- 1 root root 0 08-31 15:29 file3.txt-rw-r-r- 1 root root 5 08-31 16:17 scim-bridge-0.3.0.lockfile-0localhost:0.06)ls -i列出inode号码rootlocalhost tmp# ls -i1566732 a 1566733 b 1566730 file2.txt 1566734 scim-bridge-0.3.0.lockfile-0localhost:0.01566736 aa 1566723 file1.txt 1566731 file3.txt7)ls -R连同子目录内容全部显示rootlocalhost tmp# ls -R.:a aa b file1.txt file2.txt file3.txt scim-bridge-0.3.0.lockfile-0localhost:0.0./aa:bb./aa/bb:cc./aa/bb/cc:./b:rootlocalhost tmp# ls -s总计 120 a 4 aa 4 b 0 file1.txt 0 file2.txt 0 file3.txt 4 scim-bridge-0.3.0.lockfile-0localhost:0.08)ls -s以文件容量大小排序rootlocalhost tmp# ls -s总计 120 a 4 aa 4 b 0 file1.txt 0 file2.txt 0 file3.txt 4 scim-bridge-0.3.0.lockfile-0localhost:0.04.查看Linux内核版本uname r系统版本cat /proc/redhat-release详细信息lsb_release arootlocalhost /# uname -r2.6.18-348.el5【注】2-主版本号,6-次版本号,18-修订号,348.el5-红帽修订号【注】次版本号:奇数表示开发版,偶数表示稳定版rootlocalhost /# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.9 (Tikanga)rootlocalhost /# lsb_release -aLSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarchDistributor ID: RedHatEnterpriseServerDescription: Red Hat Enterprise Linux Server release 5.9 (Tikanga)Release: 5.9Codename: Tikanga【注】这里我们可以看到详细的Linux版本信息5.hostname查看或设置主机名rootlocalhost /# hostnamelhw.tarenarootlocalhost /# hostname beijing.chinarootlocalhost /# hostnamebeijing.china【注】hostname既可以查看主机名,也可以修改主机名6.ifconfig eth0查看第一块网卡信息rootlocalhost /# ifconfig eth0eth0 Link encap:Ethernet HWaddr 00:0C:29:96:E9:2C inet addr:192.168.10.2 Bcast:192.168.10.255 Mask:255.255.255.0 inet6 addr: fe80:20c:29ff:fe96:e92c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:5394 errors:0 dropped:0 overruns:0 frame:0 TX packets:3746 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:517745 (505.6 KiB) TX bytes:421600 (411.7 KiB)【注】这里可以产看本机的IP地址、网关、子网掩码、MAC地址等信息7.cat查看系统信息1)cat /proc/cpuinforootlocalhost /# cat /proc/cpuinfo model name : Intel(R) Core(TM) i3-3220 CPU 3.30GHzstepping : 9cpu MHz : 3292.589cache size : 3072 KB2)cat /proc/meminforootlocalhost /# cat /proc/meminfoMemTotal: 1023848 kBMemFree: 214644 kBBuffers: 65724 kBCached: 431272 kBSwapCached: 0 kB【注】上面两条命令显示的信息过长,只保留了部分做演示。8.free m查看内存和swap相关信息rootlocalhost /# free -m total used free shared buffers cachedMem: 999 790 209 0 64 421-/+ buffers/cache: 305 694Swap: 2047 0 20479.shutdown h now关机命令rootlocalhost /# shutdown -h now【注】其他关机命令init 0或halt p或poweroff,读者可自行试验【注】带提示信息的关机:shutdown h +15 “computer will be off after 15 minite”rootlocalhost /# shutdown -h +15 computer will be off after 15 miniteBroadcast message from root (pts/4) (Sat Aug 31 17:14:22 2013):computer will be off after 15 minite The system is going DOWN for system halt in 15 minutes!10.重启命令rootlocalhost /# shutdown -r nowrootlocalhost /# rebootrootlocalhost /# init 611.date查看时间1)date回车可直接查看时间rootlocalhost # date2013年 08月 31日 星期六 17:26:49 CST2)date MMDDhhmmYYYY(MM-月,DD-日,hh-时,mm-分,YYYY-年) 【注】此命令用来修改系统日期时间rootlocalhost # date 0909183020132013年 09月 09日 星期一 18:30:00 CST3)date +%Y/%m/%d 【注】显示日期rootlocalhost # date +%Y/%m/%d2013/09/094)date +%H:%m 【注】显示时间rootlocalhost # date +%H:%m18:0912.cal查看日历信息rootlocalhost # cal 2013【注】查看2013全年,此处日历省略,读者可自己实验rootlocalhost # cal 09 2013 九月 2013 日 一 二 三 四 五 六 1 2 3 4 5 6 7 8 9 10 11 12 13 1415 1
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 赤峰翁牛特旗公务员考试试题及答案
- 电缆辅材生产线项目建设工程方案
- 城市生态综合整治项目施工方案
- 北辰区公务员行测考试试题及答案
- 片区城中村改造项目施工方案
- 乡镇污水处理及配套管网工程初步设计
- 十五五规划纲要:碳市场扩容与减排激励机制创新
- 2026年建筑装饰公司装饰工艺研发立项评审管理制度
- 数据要素治理体系:“十五五”制度创新重点
- 信阳航空考试题库及答案
- 《红日》读书分享模板
- 机械伤害事故应急演练方案(现场处置方案)
- 技术经理人考试题库及答案
- 2024年国家电网网络安全专业考试题库(附答案)
- 口腔科正畸病历范文
- 钢结构桁架吊装安装专项施工方案
- 消防知识竞赛考试题(附答案)
- 2025年浙能集团甘肃有限公司新能源项目招聘22人笔试历年参考题库附带答案详解
- 佛教协会人员管理制度
- 厂区雨污水管网施工方案
- 碳排放交易课件
评论
0/150
提交评论