bash的alias(别名)不直接支持$1,$2,$3,这样的命令行参数.
所以我们可以在/etc/bashrc中, 使用函数来替代.
(但是我不知道为什么貌似alias temp='echo $1', 这样会把对temp的参数打印出来, 需要进一步确认...)
Anyway, 比如像下面这样, 可以满足我的需求
ils() { find . -maxdepth 1 -iname \*$1\* } rls() { ls -al *$1* }
BASH : Alias and Parameters
http://chinmaykamat.wordpress.com/2009/09/16/bash-alias-and-parameters/
Make bash alias that takes parameter?
http://stackoverflow.com/questions/7131670/make-bash-alias-that-takes-parameter
Pass Command Line Arguments To a Bash Alias Command
http://www.cyberciti.biz/faq/linux-unix-pass-argument-to-alias-command/
Alias, Setting command aliases
http://www.linuxhowtos.org/Tips%20and%20Tricks/command_aliases.htm
相关推荐
Index of the Bash Command Lin for Linux 格式: doc 语言: 英语
linux下提示bash-command not found.docx
Three Unix veterans present a variety of recipes and tricks for all levels of shell programmers so that anyone can become a proficient user of the most common Unix shell—the bash shell—and cygwin or...
NULL 博文链接:https://javatea.iteye.com/blog/2360941
类固醇的Alias Bash命令 Bash alias本质上不过是键盘快捷键,缩写,是避免键入长命令序列的一种手段。 由于这些原因, AKA提供了更好的替代alias命令: 别名以文件形式存储在文件系统中,因此可以轻松地在计算机...
tmux_for_git-bash 来自 github,原始链接也许不能下载。tmux_for_git-bash 来自 github,原始链接也许不能下载。
一个针对 Bash 初学者的教程,通过详细的事例介绍了 Bash 的基本支持,如何使用 Bash,以及sed, awk等工具的使用。
This Bash Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow. Text content is released under Creative Commons ...
RockLinux9 bash yum command not found
bash 4.2 for unix linux
bash: vi: command not found, 场景: 因为 docker里面没有这个命令,我们安装一下 apt-get update apt-get install vim 如果 这个时候 安装也还是会出现 异常 root@446d7cf1606c:/etc/mysql# apt-get update ...
bash 在AIX系统下的安装,命令如下: ftp上传到AIX机器上,然后运行如下命令: rpm -ivh bash-3.0-1.aix5.1.ppc.rpm
这段视频演示了 Bash 强大的命令行编辑功能,包括快速移动、删除/粘贴、命令历史、命令搜索/替换等等。一旦掌握了这些技能,将极大的提高你的生产力。
This book teaches effective shell script programming with Bash, and is ideal for people who may have used its command line but never really learned it in depth. This book will show you how even simple...
bash 远程命令执行漏洞 1. 【漏洞编号】CVE-2014-6271, 2. 【漏洞简介】该漏洞源于你调用的bash shell之前创建的特殊的环境变量,这些变量可以包含代码,同时会被bash执行。 黑客可以远程执行命令,窃取服务器上的...
cmd工具--prompt command 安装后,直接在鼠标添加了进入cmd目录里。 经常使用 cmd的人有福了
http-server安装成功后,提示 ~bash command not found 在安装目录下却可以,其实是没有配置环境变量的缘故 网上搜到的什么vim ~/.zshrc不适合我,因为我报的错不是zsh: command not found: 解决办法, 1、在mac终端...
bash-alias-completion Bash完成别名问题及其解决方案假设您有一个这样的别名: alias gc= ' git clone ' 如果您键入gc --后面接[TAB] ,则可用选项将不会完成任何bash补全。 要解决此问题,您可以在文件alias_...
用Bash Shell的for循环,每次递增数是500就行了。 代码如下:#!/bin/bash##每次递增的数ADD_NUM=500 #递增1的话取消下行注释,并相应的注释另一句for的开头的#for ((i=1;i<=29500;i++)) #递增定义的数for ((i=1;i...
This second edition has updated for Bash 4.3, and many scripts have been rewritten to make them more idiomatically Bash, taking better advantage of features specific to Bash. It is easy to read, ...