Day1

基本指令操作

ls:list(列表)

查看当前目录下未隐藏文件的信息
[root@localhost ~]# ls -l
total 4
drwxr-xr-x. 3 root root   15 Jul 29 21:56 a
-rw-r--r--. 1 root root    0 Jul 29 11:42 abc
-rw-------. 1 root root 1177 Jul 27 17:52 anaconda-ks.cfg
[root@localhost ~]# 

alias

更换名字
[root@localhost ~]# alias
alias cp='cp -i'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias mv='mv -i'
alias rm='rm -i'
alias which='(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot'
alias xzegrep='xzegrep --color=auto'
alias xzfgrep='xzfgrep --color=auto'
alias xzgrep='xzgrep --color=auto'
alias zegrep='zegrep --color=auto'
alias zfgrep='zfgrep --color=auto'
alias zgrep='zgrep --color=auto'

cd:change directory(改变目录)

切换目录
[root@localhost etc]# cd -
/root
[root@localhost ~]# cd -
/etc
[root@localhost etc]# 

快速返回到家目录
[root@localhost etc]# cd ~
[root@localhost ~]# 

pwd:print work directory(显示当前路径)

[root@localhost ~]# pwd
/root

mkdir: make directory(制造目录)

创建目录
[root@localhost ~]# mkdir tjh/a

创建多级目录
[root@localhost ~]# mkdir -p tjh/a/b/c/d

touch 创建(空文件)/覆盖状态

[root@localhost ~]# touch aaa.txt
[root@localhost ~]# ls
a  aaa.txt  abc  anaconda-ks.cfg  tjh

stat 显示文件的状态

a  aaa.txt  abc  anaconda-ks.cfg  tjh
[root@localhost ~]# stat aaa.txt
  File: aaa.txt
  Size: 0          Blocks: 0          IO Block: 4096   regular empty file
Device: fd00h/64768d Inode: 34032866    Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Context: unconfined_u:object_r:admin_home_t:s0
Access: 2020-07-30 11:27:21.020108472 +0800
Modify: 2020-07-30 11:27:21.020108472 +0800
Change: 2020-07-30 11:27:21.020108472 +0800
 Birth: -

rm:remove(删除/移除)

删除文件
[root@localhost ~]# ls
a  aaa.txt  abc  anaconda-ks.cfg  tjh
[root@localhost ~]# rm abc
rm: remove regular empty file 'abc'? y
[root@localhost ~]# ls
a  aaa.txt  anaconda-ks.cfg  tjh

强制删除(不经过询问就直接删除)

[root@localhost ~]# rm -rf aaa.txt
[root@localhost ~]# ls
a  anaconda-ks.cfg  tjh

cp:copy(复制)

复制文件
[root@localhost ~]# cp abc.txt abb.txt
[root@localhost ~]# ls
a  abb.txt  abc.txt  anaconda-ks.cfg  tjh

加-r 复制目录文件
[root@localhost ~]# cp -r a b
[root@localhost ~]# ls
a  abb.txt  abc.txt  anaconda-ks.cfg  b  tjh

mv:move(移动)

在本地移动时为重命名
[root@localhost ~]# ls
a  abb.txt  abc.txt  anaconda-ks.cfg  b  tjh
[root@localhost ~]# mv a c
[root@localhost ~]# ls
abb.txt  abc.txt  anaconda-ks.cfg  b  c  tjh

目标为其他目录时为剪切移动
[root@localhost ~]# ls
abb.txt  abc.txt  anaconda-ks.cfg  b  c  tjh
[root@localhost ~]# mv b tjh
[root@localhost ~]# ls
abb.txt  abc.txt  anaconda-ks.cfg  c  tjh
[root@localhost ~]# ls tjh/
a  b

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值