cd 切换目录
cd 目录
- [[email protected] ~]# cd /
- [[email protected] /]# ls
- application bin class dev home lib64 media nfsbackup opt python sbin server sys usr
- backup boot data etc lib lost+found mnt oldboy proc root selinux srv tmp var
- [[email protected] /]# cd /tmp
- [[email protected] tmp]# ls
- yum_save_tx-2017-10-12-23-03CsKn4P.yumtx
pwd 显示你当前的位置 显示你的当前的工作目录
pwd
你所在的路径
- [[email protected] tmp]# pwd
- /tmp
- [[email protected] tmp]# cd /usr
- [[email protected] usr]# cd bin
- [[email protected] bin]# pwd
- /usr/bin
mv 移动文件或目录 修改文件名
mv 文件名 目标目录
- [[email protected] tmp]# ls
- 1.txt yum_save_tx-2017-10-12-23-03CsKn4P.yumtx
- [[email protected] tmp]# mv 1.txt /root
- [[email protected] tmp]# cd /root
- [[email protected] ~]# ls
- 1.txt anaconda-ks.cfg anaconda-ks.cfg_q install.log install.log.syslog
- [[email protected] ~]#
touch 创建文件
touch 文件名
- [[email protected] tmp]# touch 1.txt
- [[email protected] tmp]# ls
- 1.txt yum_save_tx-2017-10-12-23-03CsKn4P.yumtx
file 查看文件属性
file 文件名
- [[email protected] tmp]# ll
- total 4
- -rw-r--r-- 1 root root 0 Nov 10 21:15 1.txt
- -rw------- 1 root root 1135 Oct 12 23:03 yum_save_tx-2017-10-12-23-03CsKn4P.yumtx
- [[email protected] tmp]# file yum_save_tx-2017-10-12-23-03CsKn4P.yumtx
- yum_save_tx-2017-10-12-23-03CsKn4P.yumtx: ASCII text
- [[email protected] tmp]# file 1.txt
- 1.txt: ASCll text
ASCII码文件 ASCII text 文本文件
mkdir 创建目录
mkdir 目录名
- [[email protected] tmp]# mkdir yyy
- [[email protected] tmp]# ll
- total 12
- -rw-r--r-- 1 root root 5 Nov 10 21:26 1.txt
- -rw------- 1 root root 1135 Oct 12 23:03 yum_save_tx-2017-10-12-23-03CsKn4P.yumtx
- drwxr-xr-x 2 root root 4096 Nov 10 21:29 yyy
时间: 2024-11-09 18:56:44