欢迎光临散文网 会员登陆 & 注册

bash命令怎么在linux系统中使用

2021-10-20 13:53 作者:Vecloud_  | 我要投稿


这篇文章将为大家详细讲解有关bash命令怎么在linux系统中使用,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。 
什么是Linux系统Linux是一种免费使用和自由传播的类UNIX操作系统,是一个基于POSIX的多用户、多任务、支持多线程和多CPU的操作系统,使用Linux能运行主要的Unix工具软件、应用程序和网络协议。 
tab键补全用法 
当我们敲击一下tab补全命令或文件名 
当我们敲击两下tab 列出相关的所有可选项 
查看以下例子 

[root@localhost /]# cd /tmp 
[root@localhost tmp]# pwd 
/tmp 
[root@localhost tmp]# cd / 
[root@localhost /]# pwd 

[root@localhost /]# cd - 
/tmp 
[root@localhost tmp]# pwd 
/tmp 
Esc+. 
用法举例 
首先touch一个文件,然后编辑这个文件 
touch abcdefghijk 
敲入vi ,然后Esc+. 发现是不是abcdefghijk已经出现在vi后面\ 
转义字符用法 
系统中一些命令都是别名的功能,比如我们使用的rm、mv等,实际上是 rm -i和mv -i 。 
查看系统别名可以使用alias命令,例如以下系统默认的别名。 
[root@localhost testdir]# 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 | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' 
有时候我们删一个文件时候,会出现以下提示, 需要我们一个个确认,原因就是rm默认就是rm -i起了作用。 
[root@localhost testdir]# cd dir1 
[root@localhost dir1]# ls 
file1 file2 file3 file4 
[root@localhost dir1]# rm file1 file2 file3 file4rm: remove regular empty file ?.ile1?. y 
rm: remove regular empty file ?.ile2?. y 
rm: remove regular empty file ?.ile3?. y 
rm: remove regular empty file ?.ile4?. y 
我们可以使用转移字符使别名失效,使用如下,删除就不会再有提示确认了。 
[root@localhost testdir]# cd dir1 
[root@localhost dir1]# ls 
file1 file2 file3 file4 
[root@localhost dir1]# \rm file1 file2 file3 file4 
关于bash命令怎么在linux系统中使用就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

了解更多网络知识关注:http://www.vecloud.com/

bash命令怎么在linux系统中使用的评论 (共 条)

分享到微博请遵守国家法律