Mandriva – Alias bash


Untuk mempermudah penulisan dan kemalasan admin sistem jaringan dalam mengontrol file log. Buatlah alias pada bash untuk mempermudahnya.

Misal :

Bosan menulis :

tail -f /var/log/syslog

atau

less /var/log/messages

?

Jika malas menulisnya, maka buatlah dengan alias. Letakkan baris perintah berikut ini ke /root/.bashrc

alias tslog='/usr/bin/tail /var/log/syslog'
alias lslog='/usr/bin/less /var/log/syslog'
alias tmsg='/usr/bin/tail /var/log/messages'
alias lmsg='/usr/bin/less /var/log/messages'
alias tauth='/usr/bin/tail /var/log/auth.log'
alias lauth='/usr/bin/less /var/log/auth.log'
alias tmail='/usr/bin/tail /var/log/mail/info'
alias lmail='/usr/bin/less /var/log/mail/info'
alias tkern='/usr/bin/tail /var/log/kernel/info'
alias lkern='/usr/bin/less /var/log/kernel/info'
alias thacc='/usr/bin/tail /var/log/httpd/access_log'
alias lhacc='/usr/bin/less /var/log/httpd/access_log'
alias therr='/usr/bin/tail /var/log/httpd/error_log'
alias lherr='/usr/bin/less /var/log/httpd/error_log'
alias thsacc='/usr/bin/tail /var/log/httpd/ssl-access_log'
alias lhsacc='/usr/bin/less /var/log/httpd/ssl-access_log'
alias thserr='/usr/bin/tail /var/log/httpd/ssl-error_log'
alias lhserr='/usr/bin/less /var/log/httpd/ssl-error_log'
alias tsmb='/usr/bin/tail /var/log/samba/log.smbd'
alias lsmb='/usr/bin/less /var/log/samba/log.smbd'
alias tnmb='/usr/bin/tail /var/log/samba/log.nmbd'
alias lnmb='/usr/bin/less /var/log/samba/log.nmbd'


alias urpmi='nice -n 15 urpmi ––split-level 10 ––split-length 8'
alias rpm='nice -n 15 rpm'
alias make='nice -n 16 make'

Alias-alias ini menjadi perintah baru setelah anda login kembali. Jika anda tidak sabar, ketik satu-satu pada prompt supaya alias tersebut bisa digunakan langsung. Pelajari bagaimana perintah baru ini dan administrasi sistem akan lebih mudah.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: