How to define alias in Linux
2017-04-18 10:46
501 查看
1. view ~/.bashrc
It looks like below:
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
alias commandA='bash ./test.sh'
2.cd ~
touch test.sh
chmod 777 test.sh
3.run ~/.bashrc
[e_dingl@test3tcapprh01 ~]$ . ~/.bashrc
4.in command line, type "commandA" and enter
==============
Other Sample :
# User specific aliases and functions
#Counts for incoming and processed
alias reads='echo -n "Incoming: "; find /home/pipe/Incoming/MultiDrive/MeterReads/ -type f | grep -v "Event" | wc -l; echo -n "Processed: "; find /home/pipe/Processed/MultiDrive/MeterReads/ -type f | grep -v "Event" | wc -l; date'
It looks like below:
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
alias commandA='bash ./test.sh'
2.cd ~
touch test.sh
chmod 777 test.sh
3.run ~/.bashrc
[e_dingl@test3tcapprh01 ~]$ . ~/.bashrc
4.in command line, type "commandA" and enter
==============
Other Sample :
# User specific aliases and functions
#Counts for incoming and processed
alias reads='echo -n "Incoming: "; find /home/pipe/Incoming/MultiDrive/MeterReads/ -type f | grep -v "Event" | wc -l; echo -n "Processed: "; find /home/pipe/Processed/MultiDrive/MeterReads/ -type f | grep -v "Event" | wc -l; date'
相关文章推荐
- linux, how to define a new array in bash
- How to use C programing language in Linux as a expert[ZT]
- Linux----How to install flash player in debian?
- How to screenshot in Linux
- How to write a Daemon process in Linux
- How to turn on RSH and RLOGIN in Linux?
- How to install Mysql in linux server
- how to use usb device in linux version 3.00.14(1)-release (i386-redhat-linux-gnu)
- HowTo use linux laptop in presentations 【如何在Linux系统上使用投影仪】
- How to install LAMP (Apache, PHP and MySQL in Linux) using Yum
- How to install multi OS(Windows/Linux) in one PC box and boot them easily
- How to read Mac .DMG file in Linux or PC(II)
- How to compile GCC-4.3.3 in the Linux?
- How to Backup Your System in linux
- How to mount filesystems in Linux
- How to setup tomcat in linux?
- How to implement realtime periodic tasks in Linux applications
- How to setup tomcat in linux?
- How to use "man" effectively in the development of Linux