找回密码
 立即注册

推荐阅读

  • 便民服务
  • 关注我们
  • 社区新手
vmware workstation软件安装完成后:虚拟机界面点击右键
第四个open in的创建

[linux@localhost Desktop]$ su root
当前用户/本地主机/桌面 $:表示为普通用户su:switch
root用户:超级管理员

password:
输入密码进入

[root@localhost Desktop]# cd /
#:超级用户的标识符  cd /:cd进入 /根目录

[root@localhost /]# ll
ll(L小写字母):表示展开目录

[root@localhost /]# ifconfig
ifconfig:获取IP地址
出现addr:192.168.***.***就是我们要的IP地址
安装xshell软件完成后:
进行获取刚刚虚拟机的IP地址输入登录用户名及密码

[root@localhost bin]# pwd
/bin
pwd:显示当前所在目录的绝对路径
我们输出的bin 当前位置就是/目录下的bin的目录

[root@localhost bin]# cd ..
[root@localhost /]#
cd ..:就是返回上级目录

[root@localhost efi]# cd ../..
[root@localhost /]#
cd ../..:就是连续返回上上级目录

[root@localhost /]# cd /boot/efi
[root@localhost efi]#
cd /***/***:直接进入指定多层级目录,加上位置
的绝对路径。

[root@localhost ~]#
~:代表家目录(root用户)home(普通用户)

[root@localhost /]# ping www.baidu.com
测试网络情况

drwxr-xr-x.   18 root root     3789 JUN  1  18:18  dev
-rw-r--r--.   8 root root      3789 JUN  1  18:18  dev
d:表示目录的意思 -(在最前面):表示文件
rwx:表示文件的权限-分别为rwx读写执行的权限
第一个root表示这个文件属于谁,一般谁创建的就属于谁 简称属主
第二个root表示这个文件属于哪个用户组 简称属组
3789:表示文件的大小 JUN  1  18:18:表示创建的日期
dev:文件名或目录名

[root@localhost /]# ls
ls:显示文件或目录

[root@localhost /]# ls -rtl
ls -rtl:目录及文件按时间进行排序

[root@localhost /]# mkdir -p wuhan3/wuhan4/wuhan5
mkdir -p:创建层级目录方法     mkdir:创建目录

[root@localhost /]# mkdir -p wuhan3 wuhan4 wuhan5
[root@localhost /]# mkdir wuhan3 wuhan4 wuhan5
mkdir和mkdir -p:创建同层级目录


[root@localhost /]#rmdir wuhan3
[root@localhost /]#rmdir wuhan4
[root@localhost /]#rmdir wuhan5
rm:删除的意思   rmdir:删除目录

[root@localhost /]# touch wuhan3.txt
touch:创建文件的方法

[root@localhost /]# cat wuhan3.txt
[root@localhost /]# less wuhan3.txt
[root@localhost /]# more wuhan3.txt
[root@localhost /]# vim wuhan3.txt
cat:直接查看显示所有信息
less:上下左右进行翻页查看ctrl+z退出
more:百分比查看内容,通过enter键进行
查看查看完成的时候自动进行退出
vim:进入文件编辑模式,按i才能够进入编辑,
按esc出现: 在冒号后面输入wq保存并退出

[root@localhost wuhan3]# rm -rf *
rm -rf *:全部删除的命令,不要在/目录下执行
*是通配符的意思

[root@localhost wuhan3]# rm -r wuhan3/wuhan4
rm -r:递归删除,删除武汉3下面的武汉4目录

[root@localhost wuhan3]# rm -rf wuhan3.txt
rm -rf:强制进行删除文件,不会有提示

[root@localhost wuhan3]# rm -i wuhan3.txt
[root@localhost wuhan3]# rm wuhan3.txt
rm -i:只能对文件进行操作,不能对目录进行操作
rm:只能针对文件删除,不能针对目录

[root@localhost wuhan3]# cp wuhan3.txt ./wuhan1
将武汉3文件拷贝到武汉3这个当前路径的武汉1目录 当前路径用./

[root@localhost wuhan3]# cp wuhan3.txt /wuhan1
cp接绝对路径,把武汉3这个文件放在根目录下面武汉1目录

[root@localhost wuhan3]# cp wuhan3.txt wuhan4.txt
拷贝一份文件取一个别名,放在当前路径所在位置

[root@localhost wuhan3]# cp -r wuhan3 wuhan4
cp目录的方法,取别名存放当前路径
[root@localhost wuhan3]# cat wuhan3.txt>wuhan4.txt
[root@localhost wuhan3]# cat wuhan3.txt>>wuhan4.txt
一个>表示覆盖:将wuhan3.txt的文件内容覆盖wuhan4.txt
两个>>追加的意思:把wuhan3.txt文件内容追加到wuhan4.txt

[root@localhost wuhan3]# mv wuhan3.txt /wuhan3
mv:移动  将wuhan3.txt这个文件移到根目录下面的wuhan3目录当中

[root@localhost wuhan3]# mv wuhan3.txt ./wuhan3
./  相对路径的移动方式

[root@localhost wuhan3]# mv wuhan3.txt wuhan4.txt
对目录进行重命名,前面是原文件,后面是修改的命名


分享至 : QQ空间
收藏

0 个回复

您需要登录后才可以回帖 登录 | 立即注册