- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: little used favorite commands...
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
08-12-2005 02:42 AM
08-12-2005 02:42 AM
little used favorite commands...
Basically my goal is to make us all aware of great little commands that most of us don't use on a daily basis...
I recently took a Posix coding class and learned of a few...
One I found very useful strangely interesting is "getopts" used in managing script command options and for formatting error messages for usage and such.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 02:47 AM
08-12-2005 02:47 AM
Re: little used favorite commands...
The biggest pain with these is the lack of man entries in the OS itself - although you can get man pages online a www.docs.hp.com
Cheers,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 02:56 AM
08-12-2005 02:56 AM
Re: little used favorite commands...
useful for looking at hardware information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 02:58 AM
08-12-2005 02:58 AM
Re: little used favorite commands...
dig CHAOS TXT version.bind @some.dns.server
But you can change it in named.conf in the options section:
version "Wild DNS 1.0";
Sendmail version:
sendmail -v -d0.1 < /dev/null
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 03:14 AM
08-12-2005 03:14 AM
Re: little used favorite commands...
quot, expand_alias, sendmail -v
df -g
UNIX95= ps -C
may more there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 03:17 AM
08-12-2005 03:17 AM
Re: little used favorite commands...
UNIX95= ps -e -o vsz=Kbytes -o ruser -o pid,args=Command-Line | sort -rnk1 | grep -v Kbytes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 03:23 AM
08-12-2005 03:23 AM
Re: little used favorite commands...
eg: -
clear
tput cup 5 10
tput smso
echo "Main Menu"
tput cup 6 10
tput sgr0
echo "Option 1"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 03:41 AM
08-12-2005 03:41 AM
Re: little used favorite commands...
man tunefs
Which I'm sure you're all aware of already.
I like it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 03:41 AM
08-12-2005 03:41 AM
Re: little used favorite commands...
usr/sbin/sar -u -M > /logging/perf/`date +%b%Y`/cpu`date +%d` 2> /dev/null
/usr/sbin/sar -b > /logging/perf/`date +%b%Y`/buffer`date +%d` 2> /dev/null
/usr/sbin/sar -d > /logging/perf/`date +%b%Y`/disk`date +%d` 2> /dev/null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 03:57 AM
08-12-2005 03:57 AM
Re: little used favorite commands...
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=406126
Here's a new one to go on the list
rev - reverses the lines in a file.
eg:
=> cat file1
one
two
three
four
five
six
=>rev file1
eno
owt
eerht
ruof
evif
xis
I'm sure there are endless applications for this, but personally, I used it to write a fake shell for April Fools Day :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 04:00 AM
08-12-2005 04:00 AM
Re: little used favorite commands...
Heh well that was 18 months ago so I'm due a repeat!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 04:09 AM
08-12-2005 04:09 AM
Re: little used favorite commands...
echo "0x2008?4D"| adb /dev/dsk/c-t-d-
the output gives you for each field, if I can ready my old notes:
1=address of lvm data
2=system/cpu id
3=pvid
4=system/cpu id
5=vgid
...I compare a disk that is in the vg and one that is reporting error (but should be in same vg)...if field 5 don't match that confirms the problem...
Rgrds,
Rita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 04:16 AM
08-12-2005 04:16 AM
Re: little used favorite commands...
rawdevice=/dev/rdsk/cXtXdX
mkboot -l ${rawdevice}
mkboot -a "hpux -lq (;0)/stand/vmunix" ${rawdevice}
cd /usr/sbin/diag/lif
width=`getconf KERNEL_BITS`
if [ $width -eq 64 ]
then
mkboot -b updatediaglif2 -p ISL -p AUTO -p HPUX -p LABEL ${rawdevice}
else
mkboot -b updatediaglif -p ISL -p AUTO -p HPUX -p LABEL ${rawdevice}
fi
lvlnboot -r /dev/vg00/lvol3 # root fs /
lvlnboot -s /dev/vg00/lvol2 #swap
lvlnboot -d /dev/vg00/lvol2 #swap/dump
lvlnboot -b /dev/vg00/lvol1
lvlnboot -R
lvlnboot -v
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 05:09 AM
08-12-2005 05:09 AM
Re: little used favorite commands...
# mkfs -m /dev/vgXX/lvolY
display contents of the superblock:
# fstyp -v /dev/vgXX/rlvolY
Moving all "*.arc" files to "*.old" in current dir:
# ls *.arc | awk -F"arc" '{system("cp "$0" "$1"old")}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2005 11:53 AM
08-13-2005 11:53 AM
Re: little used favorite commands...
alias -x llast='ll -t | head -23' # ll most recent files`
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 10:03 AM
08-18-2005 10:03 AM
Re: little used favorite commands...
So instead of
lp -dprinter -oduplex -otray3 -o3hole -onb
I do
lp -dprinter -o'duplex tray3 3hole nb'
Also, printing out man pages so that they paginate correctly
man man | lp -dprinter -on
Marlou
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 10:43 AM
08-18-2005 10:43 AM
Re: little used favorite commands...
# strings /etc/lvmtab
to see the volumegroup entry in the lvmtab file.
thanks
Dp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 11:36 AM
08-18-2005 11:36 AM
Re: little used favorite commands...
whence (you'll never use which or whereis again)
type (even better than whence)
logins -d (a great security check)
ioscan -k (ultra-fast option)
ioscan -kfC lan (or disk or tape..)
addqueue (for JetDirect printers)
setboot (especially the SpeedyBoot options in 11.11)
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 02:49 PM
08-18-2005 02:49 PM
Re: little used favorite commands...
I dont know any of this group have tried the command "yes"...this can be used to generate repeated outputs in a shell script. But I havent seen this used by any one yet. I think this is very rarely used.
eg:
#yes " How are you??"
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
How are you??
Regards,
Syam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 02:58 PM
08-18-2005 02:58 PM
Re: little used favorite commands...
what about the following commands.
These are rarely used and can do special functions.
lock locks the screen ( try this :-)
doscp dos copy
split split a bigger file into small pieces.
ftpwho shows the ftp user info
fold formating the colum width. ( try fold -30 /etc/issue)
Regards,
Syam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 07:19 PM
08-18-2005 07:19 PM
Re: little used favorite commands...
below;
echo "USERS BELOW LOCK!!!!:\r"
for USER in $(listusers | awk '{print $1}')
do
lock_pos=$(/usr/lbin/getprpw -r -m lockout $USER)
user_name=$(grep $USER /etc/passwd|awk -F: '{print $5}')
if [ $lock_pos != "0000000" ]
then
echo "$USER $user_name $lock_pos"
fi
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 08:26 PM
08-18-2005 08:26 PM
Re: little used favorite commands...
UNIX95= ps -eH -> hierarchical presentation of processes
/etc/motd -> message of the day
clear -> clear the screen
rm -r / -> have never used this :-)
Regards,
Borislav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2005 08:49 PM
08-18-2005 08:49 PM
Re: little used favorite commands...
ux2dos "filename" > "filename.att" | uuencode "filename.att" | mailx -m -s "SUBJECT" pippo@pippo.com
rm $1.att
Regards, Ernesto.