美文网首页
Shell(二)常用命令和技巧

Shell(二)常用命令和技巧

作者: 生信了 | 来源:发表于2019-11-18 22:24 被阅读0次

命令行一些技巧:

  • 表示任意字符(也可以无字符)

?

任意一个单字符

[a-z]

包含一个字符范围中的任一字符

[^a-z]

不包含此范围的字符

Tab键

补齐命令名称或其他名称

history

重新输入以前执行过的指令

    !+序号

^

替代上个命令中的某一段字符

    如^2^1 将上个命令中的1替换为2

~

进入家目录(home directory)

    ~root

    ~user1

$

变量名

    如 echo $HOME

{}

排列组合

    a{a,b}=aa,ab

`` or $()

优先执行的命令

    echo "Hostname: `hostname`"

$[]

进行数学计算

    echo $[$a + $b]

\

后面的命令接着前面的

"

禁止所有特殊资源的功能,除了$ \ ` !

'

禁止所有特殊资源的功能

<Esc>+. or <Alt>+.

补齐上个命令的最后一个参数

set -o/+o vi

切换编辑模式

常用命令:
date
cal: calendar
pwd: parent working directory
cd: change directory
ls: list directory contents
cp: copy files and directories
mv: move and/or rename files and directories
rm: remove files
touch: create empty files or update file timestamps
mkdir: make a directory
rmdir: remove an empty directory
file: check file type
cat: view an entire text file
less: view text page by page
cut: display specific columns of file data
sort: sort text to standard out - original file unchanged
chmod: change access modes
df: report disk space usage(free)
du: report disk space usage(used)
tar: create/extract an archive
gzip: compress
bzip: compress
gunzip: extract
bunzip: extract
passwd: change password
su: start a new shell as a different user
sed: search and replace
head: display first few lines(default 10 lines) of text in a file
tail: display last few lines(default 10 lines) of text in a file
wc: "count lines, words and characters"
uniq: "remove successive, duplicate lines in a file"
paste: paste files together
tr: character translator
diff: version comparison
sdiff: version comparison
aspell: spell checking
expand: expand tabs into spaces
fmt: reformat text into paragraphs
pr: reformat text for printing
top: display snapshot of processes
vmstat: report virtual memory stats
free: summary of system memory usage
renice: change priority of a process
kill: send system signal to a process
fdisk: create partitions
partprobe: reinitialize the kernel in memory of the partition table
mke2fs: filesystem creation
lsattr: display file attributes
chattr: change file attributes
ln: linkname
alias: create shortcuts to commands
whoami: find out who you are
groups: find out what groups you belong to
id: find out what groups you belong to
users: find out who is logged in
who: find out who is logged in
w: find out who is logged in
last: login/reboot history

公众号:生信了


image

相关文章

  • Shell(二)常用命令和技巧

    命令行一些技巧: 表示任意字符(也可以无字符) ? [a-z] [^a-z] Tab键 history ^ ~ $...

  • Shell参考资料

    shell 目录 Shell简介 Shell常用命令 Shell里面的括号 Shell里面的单引号和双引号 She...

  • Shell命令汇总

    1、一般常用命令 (1)Shell 常用命令总结 (2)Shell的18条常用命令整理 2、文件操作常用命令 (1...

  • HBASE SHELL常用命令

    HBASE SHELL常用命令 标签: HBase Shell 1. 进入hbase shell console ...

  • Linux Shell: 各种tips

    通用Linux中执行shell脚本的4种方法总结hbase shell基础和常用命令详解 2.字符串Shell脚本...

  • Shell脚本

    shell脚本学习笔记 shell命令的组合运用 常用命令组合

  • Shell使用技巧和常用命令

    shell usage tips ctrl + wdelete a word before cursor ctrl...

  • unix常用命令

    UNIX操作指引 目录 1 Shell常用命令.....................................

  • Shell编程、part1

    1.shell简介2. shell分类3. 查看shell4. 第一个shell脚本5. shell编程常用命令5...

  • iOS大纲

    一、语言主要开发语言:swift、oc相关开发语言:c、c++、js、汇编、Linux常用命令、shell脚本 二...

网友评论

      本文标题:Shell(二)常用命令和技巧

      本文链接:https://www.haomeiwen.com/subject/icdiictx.html