- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Favorite Command Aliases
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 06:01 AM
06-08-2006 06:01 AM
I've seen some excellent threads on favorite sysadmin shell scripts, but haven't seen anything similar for favorite command aliases. Perhaps not as interesting a topic, but one that could prove to be fun and useful. Top points for the best command aliases.
Here are a few of mine:
alias lld='ls -l | grep ^d'
alias lis='tail -f listener.log | sed -f lfilter.sed' # Makes Oracle's listener.log legible
alias locate='zcat /var/opt/locate/loc.db.Z | grep' # loc.db.Z is updated daily
alias logcheck='more
alias ip='/usr/sbin/arp `hostname`'
PCS
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 06:04 AM
06-08-2006 06:04 AM
Solution##########################################################################
# psg - Process Search
# Substitute for "ps -ef|grep" command string.
##########################################################################
case $# in
0) echo "Error: Argument Expected";
exit;
;;
1) ps -ef | grep $1 | grep -v "grep"
# 1) UNIX95= ps -fC $1
;;
*) echo "Error: Only 1 Argument Allowed";
exit;
;;
esac
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 06:04 AM
06-08-2006 06:04 AM
Re: Favorite Command Aliases
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 06:14 AM
06-08-2006 06:14 AM
Re: Favorite Command Aliases
or
alias lld='ll |grep ^d'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 07:01 AM
06-08-2006 07:01 AM
Re: Favorite Command Aliases
---------------
alias lld='ll
---------------
should be
alias lld='ll -rt|grep ^d'
bdf in mb:
----------
this is actually a script like Pete told, i converted it as an alias:
alias bdfmb = echo "Filesystem Mbytes used avail %used Mounted on" | bdf | grep -v Filesystem | awk '{ printf("%s %10d %10d %10d %4s %s\n",$1,$2/1024,$3/1024,$4/1024,$5,$6)}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 07:15 AM
06-08-2006 07:15 AM
Re: Favorite Command Aliases
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 08:13 AM
06-08-2006 08:13 AM
Re: Favorite Command Aliases
alias dog=cat
It goes quite well with my habit of naming temp/junk files that I'm going to throw away "poop".
It is just so stupid and corny, I've always enjoyed it, and to me (and I'm pretty sure only to me) it's right up there with the warning section of tunefs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 08:27 AM
06-08-2006 08:27 AM
Re: Favorite Command Aliases
When using aliasses, the first alias is - of course - 'a'
alais a alias
The second would be 'h
a h history
alias . source
alias > glob "" >
alias a alias
alias cd3 cd /pro/3gl/!*
alias cdp cd /pro/3gl/CPAN/!*
alias dbperl perl -MPROCURA::DBD -e'$d = DBDlogon (1);'
alias for foreach i ( !* )
alias h history
alias j jobs
alias l ls --color=auto -aCF
alias ll ls --color=auto -ali
alias ls ls $LS_OPTIONS
alias man env TERM=vt100 man
alias pg pg -p "Pg %d > " -n
alias sd sccs diffs !*
alias ve sccs edit !*; $VISUAL !*
alias vi elvis -Gx11 -fork
And next to aliasses, there is the complete functionality. Maybe even more powerful than aliasses
complete cd 'p,1,d,'
complete cd3 'p,1,D:/pro/3gl/,'
complete cdp 'p,1,D:/pro/3gl/CPAN/,'
complete ftp 'p,1,`perl -lnae'$F[1]&&$h{$F[1]}++}END{print for sort keys%h' ~/.netrc 'netstat -r|sed s/^/\ /|'`,'
complete path 'n,-e,c,'
complete sccs 'p,2,`sccs tell`,'
complete sd 'p,1,`sccs tell`,'
complete ssh 'p,1,`perl -lnae'$F[1]&&$h{$F[1]}++}END{print for sort keys%h' ~/.netrc 'netstat -r|sed s/^/\ /|'`,'
complete telnet 'p,1,`perl -lnae'$F[1]&&$h{$F[1]}++}END{print for sort keys%h' ~/.netrc 'netstat -r|sed s/^/\ /|'`,'
complete unsetenv 'p,1,e,'
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 01:39 AM
06-09-2006 01:39 AM
Re: Favorite Command Aliases
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 01:46 AM
06-09-2006 01:46 AM
Re: Favorite Command Aliases
What I do like is:
set -o vi
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 02:18 AM
06-09-2006 02:18 AM
Re: Favorite Command Aliases
I generally keep aliases to a minimum as well. I do like to have my environment set up the way I like it though so I generally have my own environment file which I source as soon as I execute /bin/ksh -o vi..
I also have those set as function keys, so when I log into a box, I hit f7 (executes /bin/ksh -o vi) and f8 (sources /root/mcd)
The function keys are set up via a ~/.Xdefaults file:$ cat /home/dkoleary/.Xdefaults
*ttyModes: erase
*VT100.Translations: #override \
I do use functions however. I've included my mcd as an attachment. The two really cool functions are mcd and whenis.
mcd sets the xterm title whenever you cd into a directory. So, the title of my current xterm window says:
dkoleary@usildb13:/usr/bin
whenis displays the current number of days since jan 1 1970. Anyone using the shadow password patch vs trusted systems will understand the need for that. It'll also display the date for any number supplied as a cli arg:
# whenis
13308
# whenis $((13308-45))
04/25/06
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 03:22 AM
06-09-2006 03:22 AM
Re: Favorite Command Aliases
And if you work on numerous systems, not all systems will have aliases.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 03:32 AM
06-09-2006 03:32 AM
Re: Favorite Command Aliases
this is my preferred list on HP-UX:
alias rm='rm -i'
alias mv='mv -i'
alias cp='cp -i'
alias m='pg -s -p " Page: %d "'
alias v='vi'
alias erase="cp /dev/null "
alias ll='ls -AFl'
alias lm='ll|m'
# to see file accessed today
alias lla='ll|grep "$(date +%b" "%e)"'
alias lh='ls -AFl|grep " \."|grep -v "^d"|m'
alias lk='ls -AFl|grep "^l"|m'
alias dir='ls -AFl|grep "^d"|m'
alias makex='chmod u+x'
alias env='env|m'
alias flist='typeset +f'
alias catn='cat -n'
alias psme='ps -fu $(whoami)|grep -v $$'
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2006 10:33 PM
06-12-2006 10:33 PM
Re: Favorite Command Aliases
tx="tar xvf"
tc="tar cvf"
duk="du -k|sort -k1,1nr|pg"
Mark syder (like the drink but spelt different)