HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

Profile question

 
SOLVED
Go to solution
Adam W.
Valued Contributor

Profile question

How would one go about setting his profile, so that when the command ll was ran, it would show in megs instead of bytes? Is this easily possible?
There are two types of people in the world, Marines and those who wish they were.
5 REPLIES
James R. Ferguson
Acclaimed Contributor
Solution

Re: Profile question

Hi Adam:

I assume that you mean Bill Hassell's 'bdf' script?

Regardless, you can create an 'alias' in your '.profile' as for example:

...
alias cp='cp -ip'
alias du='du -k'
alias bdf='/usr/local/bin/bdfmegs.sh'
...

See Bill's latest here:

http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1291639

Regards!

...JRF...

Patrick Wallek
Honored Contributor

Re: Profile question

That is not easily done. You would have to create your own 'll'. The HP-UX 'ls' program does not have an option to output size in MB.

Autocross.US
Trusted Contributor

Re: Profile question

ll doesn't support output in megabytes by default. You'd have to create a script to display the output in megabytes, then create an alias in your .profile to the script.
I drive way too fast to worry about calories.
Adam W.
Valued Contributor

Re: Profile question

I thought so, but I though maybe some of the gods/powers that be, would know an easier way. Thanks everyone.
There are two types of people in the world, Marines and those who wish they were.
James R. Ferguson
Acclaimed Contributor

Re: Profile question

Hi (again) Adam:

Oh, if you mean the output of 'ls' a crude but simple solution might be:

# cat /usr/local/bin/myls
#!/usr/bin/sh
ls -l | awk '{$5=(sprintf "%2.2f",$5/1024/1024);print}'

Now, in your '.profile':

alias ls='/usr/local/bin/myls'

...The format is preserved and the output calculated in MB.

Regards!

...JRF...