1. 程式人生 > >自己總結LINUX命令及記憶

自己總結LINUX命令及記憶

alias 檢視別名和設定別名
例子:
alias
顯示:
alias cp='cp -i'
alias egrep='grep --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='echo "Command not found!"'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
設定別名:
alias rm='echo "Command not found!"'

lsattr 檢視檔案 系統屬性
例子:
lsattr
顯示:
-------------e- /bin/cat

chattr 設定檔案系統屬性(acdeijstuADST),常:
例子:
chattr +a /bin/cat
chattr -a /bin/cat
chattr +i /bin/cat
chattr -i /bin/cat

state [檔案路徑] 檢視檔案屬性
例子:state /bin/cat
File: `/bin/cat'
Size: 48568 Blocks: 96 IO Block: 4096 regular file
Device: 803h/2051d Inode: 786462 Links: 1
Access: (4755/-rwsr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2019-01-02 22:07:55.121000310 +0800
Modify: 2017-03-23 02:52:45.000000000 +0800
Change: 2019-01-02 22:05:03.678999618 +0800