- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Favorite Little used 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
01-29-2004 04:19 AM
01-29-2004 04:19 AM
Favorite Little used commands
My goal on this thread is to post those commands which are little used but can be very useful... I will get us started.
Comparing files... ## All very nice for manipulating files with data.
diff
cmp
comm
uniq
-----------------------------------------------
getconf a VERY nice little command to pull data from your system...
getconf HW_CPU_SUPP_BITS
## This tells you whether you are running 32 or 64 bit OS. There are a plethora of criteria in the man page.
"vacation" is a great fun little one as well as "cal"
Good answers get 5 points... please only post once if possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 04:33 AM
01-29-2004 04:33 AM
Re: Favorite Little used commands
Really 'comm' is a useful command that got me into mess yesterday because I used it so few times that I forgot it's syntax and misinterpreted the man page :-).
Some of the useful but seldom used commands are
xargs
basename
bdiff
dirname
tput
jobs
etc
Can really save a lot of scripting time.
However, this is dependent on each person. My little commands may be heavily used by others.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 04:36 AM
01-29-2004 04:36 AM
Re: Favorite Little used commands
I also use pr a lot. A lot of older System V computers do not have the "wc" command, but they do have pr. So "cat FILE|pr -n -t|tail -1| awk '{ print $1 }'" does the same thing as "wc -l" but for only a gazillion more CPU clock cycles.
This command is also handy for numbering printed output: "pr -n FILE |lpr -d DESTINATION" give you a nicely formatted hardcopy output of your 200 line shell scripts.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 05:11 AM
01-29-2004 05:11 AM
Re: Favorite Little used commands
I use them infrequently but split & csplit are nice little commands to break up huge files (logs?) into more manageable sizes. Saves a heck of a lot of coding. But Merijn could probably do a one-liner in a coupe of seconds...
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 05:24 AM
01-29-2004 05:24 AM
Re: Favorite Little used commands
rmnl
printf
type-shell in built command
resize
tput
strings
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 05:47 AM
01-29-2004 05:47 AM
Re: Favorite Little used commands
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 05:47 AM
01-29-2004 05:47 AM
Re: Favorite Little used commands
Another nice one is "units" partly because you can find out how many centimeters there are in light year but also because you can convert gallons to degree centigrade!
Special mention goes to "lint" but only because the man page used to be titled "removes bits of fluff from C programs"
Perhaps "file" is good too, particularly if you start playing with /etc/magic
Best unix command of all time, however, is "nethack"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 06:05 AM
01-29-2004 06:05 AM
Re: Favorite Little used commands
When I'm trying to get a look at traffic flow i use netstat -i 2
I rarely see it used or recommended.
2 is the 2 from lan2
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 07:19 AM
01-29-2004 07:19 AM
Re: Favorite Little used commands
file
On executables, it will let you know if its 64-bit (including the kernel)
fold
fold -b -w 60 makes those editor files wrap nicely for email.
awk
I work with customers who can't boot systems past single user mode and who can't mount /usr. awk will allow you to do a lot of the functions of grep and sed (at least on a small scale) with a certain amount of ease.
Best regards,
Kent M. Ostby
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 07:22 AM
01-29-2004 07:22 AM
Re: Favorite Little used commands
getprpw
tsconvert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 07:35 AM
01-29-2004 07:35 AM
Re: Favorite Little used commands
Hi Todd,
Guess I didn't scroll up far enough when I checked the name. Ah heck - you purple pointy heads all look alike anyway ;~)) Or maybe I just need glasses 8^))
Cheers,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 07:57 AM
01-29-2004 07:57 AM
Re: Favorite Little used commands
The command "join" is perhaps little known but very useful for scripting. It matches filds from two files and print out selected fields from both files. In difference to may other commands it also works in "one to many" relations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 08:06 AM
01-29-2004 08:06 AM
Re: Favorite Little used commands
A similar useful command is usermod.sam which is in /usr/sam/lbin.
Here's a word processing command: adjust
Unlike fold which simply breaks at a column, adjust will break between words. I use adjust in vi to align paragraphs. Type this command:
!}exec adjust -m72
while vi is pointing to a bunch of text and the paragraph (words on multiple lines followed by a blank line) will be adjusted to 72 chars or less with all words intact.
One of my favorites is ps but not the standard behavior. I use the UNIX95 variable to enable special features such as a hierarchical listing of parent/child programs, or to search for a program WITHOUT grep, or design-a-ps with -o:
UNIX95= ps -eH
UNIX95= ps -C sh
UNIX95= ps -e -o pid,vsz,args
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 08:12 AM
01-29-2004 08:12 AM
Re: Favorite Little used commands
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 08:46 AM
01-29-2004 08:46 AM
Re: Favorite Little used commands
keep em coming!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 08:55 AM
01-29-2004 08:55 AM
Re: Favorite Little used commands
killall
sometimes helps unmount a troublesome filesystem (although that's not much of a system left afterward.
which and whereis (I knew I left that file around here somewhere)
/etc/motd
for notices to users
..and the cute one, 'make love'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 08:59 AM
01-29-2004 08:59 AM
Re: Favorite Little used commands
ipcs - information of semaphores
ipcrm - great when an oracle DB did not clean up after itself when it was halted, and won't restart because of semaphore usage.
/usr/sam/lbin/usermod.sam -F -p "" root
I got this one from the HP forums long ago. If you have root priviledges (ex: sudo), but the root password is lost and you can't change it because passwd wants the old password, this command will help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 09:20 AM
01-29-2004 09:20 AM
Re: Favorite Little used commands
$ yes "I've got a bad boss"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 01:12 PM
01-29-2004 01:12 PM
Re: Favorite Little used commands
From the tunefs man page:
You can tune a file system, but you can't tune a fish.
(sorry, the humor doesn't translate easily into other languages)
This is a favorite for new computer students:
# make love
Make: Don't know how to make love. Stop.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 04:20 PM
01-29-2004 04:20 PM
Re: Favorite Little used commands
% got a light?
No match.
Seriously: dirs -l, pushd, popd for managing your cwd.
To reset a locked account (trusted system): /usr/lbin/modprpw -k username
Also: banner, dc, checknr, fixman, from, leave, lock, od, w
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 07:08 PM
01-29-2004 07:08 PM
Re: Favorite Little used commands
omnidb -ses -det -last 2 | grep -i
When it's just gotta be safe:
scp -i
In case you're having a 'stupid' day:
alias rm='rm -i'
One of my favourite things:
set -o vi
Another of my favourite things:
cutview, have lots of cut and paste buffers, never struggle to remember all those long commands again ;-)(available from the porting asnd archive centers).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 07:11 PM
01-29-2004 07:11 PM
Re: Favorite Little used commands
As I know unix fron System III days, I'm still quite fond of 'lp'. The old, simple tty-based command is not easy to configure, but it's use is very transparant, and not as obscure as lps or AIX' printing system. One can have piggy-bag printers by defining a printer interface - which are simple shell scripts under lp in /etc/lp/interface - and have it's output not go to the device, but piped to another lp command.
By then only sh and csh existed and csh was much more user friendly than sh. Later came ksh, bash and other posix based and extended shells, but being fond of C and the csh, I switch to the tcsh quite early, and still use that on all my machines.
I also like pr, comm, sort, awk, sh, sed, uniq, pwd, ssh, ls, size, what (who else uses what these days?), sccs, ident (a bit like what, but for rcs files), and file.
wc is good, especially when used in a pipe, since it then doesn't show the filename, and the count can be used as a number without munging. cut and paste are fine too even when not used together.
Next to ps, I regularly use perl modules to seak program info, and lsof, chatr, model, getconf, adb, bc, cstm, odump, elfdump help me with system and process info a lot, as does the sw suite (swlist, swremove, swinstall). I use SAM only to extend and maintain logical volumes. And I've not seen fuser been mentioned yet. I often use it with -c to check the use of file systems I want to unmount.
I still use all the above commands, even though most of them get replaced with perl internal calls once they have to be used in a script. All scripts expected to be over three lines are written in Perl.
I am in love with elvis (the best vi clone around), and less (highly configurable more), and GNU grep (which in my ports has PCRE as default regex engine). Pass grep an extra argument of /dev/null if you only grep in one file to get the filename in front of the grepped pattern
The best internet related command is wget. By far. Use it once, use it twice, and you miss it on systems that did not install it. Next to wget, I use rsync a lot, and indirectly samba (or CiFS), which you seldom use from the active side (smbclient -M is a great way to annoy users), but mostly from the passive side (Win32 exploder) is a great way to share stuff. Ethereal is a util that needs time to understand (and I still don't), but wow, does it give a lot of information.
HP's diff is OK, GNU diff utils are good, but when examining changes to large files, xdiff is much better (if you have X11), but the best in this field is xxdiff, though you will need Qt, and it is a PITA to get it compiled.
xargs and find are buddies. find ... | xargs is a very useful combo
ttytpe is little used: only at logon, but it is so damned good, that I used trace programs like lsof, strings, adb, gdb, and tusc (once again a very good program that you only need once a year, but then proves very valuable) to rewrite it from scratch so I can use it on AIX and Linux. HP has done an awful good job here. (Even though JRF thinks it might send terminals to Lalaland :)
I hate emacs, GNU info related stuff, IE, OE, and OSF/1 based systems
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 07:25 PM
01-29-2004 07:25 PM
Re: Favorite Little used commands
I'm glad someone else hates GNU "info"!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 07:43 PM
01-29-2004 07:43 PM
Re: Favorite Little used commands
From the man page
diff3 compares three versions of a file, and prints disagreeing ranges of text flagged with these codes:
==== all three files differ
====1 file1 is different
====2 file2 is different
====3 file3 is different
May not be useful every day, but in the past I have been glad of it!
And I also use expr, so Mark Grant is not the only one!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 07:57 PM
01-29-2004 07:57 PM
Re: Favorite Little used commands
1. I also use expr, but perl is much more useful here, because IMHO the syntax of expr is a bit odd
2. diff3 is included in GNU diffutils, and both xdiff and xxdif that I mentioned as supreme understand and support diff3. And yes, it IS useful
Enjoy, Have FUN! H.Merijn