...

Alias Command in Linux

Awk Command in Linux

cat

"cat" stands for "concatenate".

显示文件内容:

cat file

Concatenate multiple file content:

cat file1 file2

cd

"cd" stands for "change directory".

Change directory:

cd dest

chmod

"chmod" stands for "change mode".

修改文件权限:

chmod 744 target
chmod u+r target
# chmod {involve}+{permission} target
# involve: u for current user, g for current group, o for other, a for all
# permission: r for read, w for write, x for execute

递归修改权限:

chmod -R 744 target

chown

"chown" stands for "change owner".

修改文件拥有者:

chown username target
chown -R username target # "recursive"

chgrp

"chgrp" stands for "change group".

修改文件拥有组:

chgrp group target
chgrp -R group target # "recursive"

cp

"cp" stands for "copy".

cp src dest
cp -R src dest # "recursive"

Curl Command in Linux

Df Command in Linux

Du Command in Linux

File Command in Linux

Find Command in Linux

Free Command in Linux

Grep Command in Linux

Groups Command in Linux

Head Command in Linux

Id Command in Linux

Ip Command in Linux

Kill Command in Linux

Less Command in Linux

ln

"ln" stands for "link".

创建指向目标 "target" 的硬链接 "link":

ln target link

根据硬链接的定义, "target" 和 "link" 地位实际上是相同的.

创建指向目标 "target" 的软链接 "link":

ln -s target link

替换软链接目标 (而不是删除再重建):

ln -sfn new-target link

如果 link 的原目标不是目录, 可以直接 ln -sf new-target link, 如果不加 -n, 同时 link 的原目标又是一个目录, 结果建立的软链接会是 link/link -> new-target

Ls Command in Linux

Lsb_release Command in Linux

mkdir

"mkdir" stands for "make directory".

mkdir target
mkdir -p target # parents, no error if existing, make parent directories as needed

More Command in Linux

Nl Command in Linux

Passwd Command in Linux

Pgrep Command in Linux

Pkill Command in Linux

Ps Command in Linux

rm

"rm" stands for "remove".

rm target
rm -f target # "force"
rm -r target # "recursive"

rsync

Sync file from source to destination:

rsync src dest
rsync src1 src2 dest # multiple sources
rsync -r src dest # "recursive"
rsync -r src --exclude=file dest # exclude files
rsync -a src dest # "archive", equals -rlptgoD, you can always use it safely whenever you sync files

Sed Command in Linux

Sort Command in Linux

ssh

创建 SSH 连接:

ssh user@port
ssh -p 22 user@host # "port"

ssh-add

添加私钥到 SSH 代理:

ssh-add path-to-file
ssh-add -l # "list",列出所有私钥的指纹
ssh-add -L # "list",列出所有私钥内容
ssh-add -D # "delete",删除所有私钥

Systemctl Command in Linux

Tail Command in Linux

Tee Command in Linux

Type Command in Linux

Uname Command in Linux

Uniq Command in Linux

Useradd Command in Linux

Usermod Command in Linux

vi

Vim.

vi file

Watch Command in Linux

Wc Command in Linux

Which Command in Linux

whoami

"whoami" stands for "who am I"

Show current user:

whoami

Xargs Command in Linux

wbswjc-blog