Your Ad Here

Jumat, 08 Agustus 2014

Unix Tip: CONVERTING UNIX MAN PAGES

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 3468 - August 8, 2014

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


CONVERTING UNIX MAN PAGES

(Another approach)

To convert Unix Man pages
to text format, you can make
use of one feature of 'man'
itself.

(Check out man man)

Set environment variable PAGER
to 'cat'. Then run

% man command_name > command_name.txt

eg. in csh, to see man ls in
a text file

% setenv PAGER cat
% man ls > ls.txt

NOTE: Do not forget to unsetenv
PAGER, else you will have to
pipe every man command to
'more' or (my favourite) 'less'.


This tip generously supported by: amar_san@yahoo.com


--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================

Kamis, 07 Agustus 2014

Unix Tip: REMOVING FILES WITH BAD FILE NAMES

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 3467 - August 7, 2014

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


REMOVING FILES WITH BAD FILE NAMES

If a file has a special
character, Unix will try to
interpret the character.
Renaming these type of files
cannot be done with a simple
"mv".....it will have to be
done using the file's inode.

For example:
# ls -i "GSO (website)"
(the "-i" flag will display the file's inode)
41734 GSO(website)

...the inode for the "bad" file is "41734"

1. once the inode is identified, use the find command to
rename the file:

find . -inum 41734 -exec mv \{\} NewName \;

2. do an "ls" to verify


This tip generously supported by: arimaldo@earthlink.net


--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================

Rabu, 06 Agustus 2014

Unix Tip: CSH PROMPT SETTING

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 3466 - August 6, 2014

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


CSH PROMPT SETTING

In (t)csh, here is a better way to
set your prompt to always let you
know where on the system you are.
In your .cshrc file, add
or set the following line:

set prompt = "%m%/% "

This way, whenever you press return,
or a job finishes, the prompt will
always tell you where you are,
without having to change directories
first. Of extra usefulness, the '%m%'
token expands to the machine name.
If you work on a multimachine system,
knowing which machine you're on is
usually of more immediate importance
than where on the machine you are.



--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================

Selasa, 05 Agustus 2014

Unix Tip: CONVERT TEXT2HTML

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 3465 - August 5, 2014

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


CONVERT TEXT2HTML

Ever felt the need to convert a
text file to html?

Create a file named txt2html
with the following contents

# Always start the output with
#an html header

BEGIN {print "<html>"
print "<head>"

# use the name of the inputfile
# as title

print "<title>" FILENAME "</title>"
print "</head>"

# The text is formatted
# already, so use <pre>

print "<body><pre>"}

# lines consisting of a number
# of dashes (more than 1) are
# replaced by a <hr>

/^---*$/ {print "<hr align=\"left\" width=" length "0 size=1>"; next}

# lines consisting of a number of equalsigns are replaced
# by a thick <hr>

/^===*$/ {print "<hr align=\"left\" width=" length "0 size=3>"; next}

# less than and greater than
# sign must me replaced by tags.

{gsub("<","\&lt;")
gsub(">","\&gt;")

# Replace form feeds by a
# couple of empty lines

gsub("^L","<br>\&nbsp;<br>\&nbsp;<br>\&nbsp;<br>")
print}

# At the end of the output,
# we must add some closing tags.

END {print "</pre></body>"}

Make this executable
(chmod a+x txt2html) and you're
ready to start converting your test files.

txt2html something.txt > something.html


This tip generously supported by: ugu@couprie.org


--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================

Senin, 04 Agustus 2014

Unix Tip: EFFICIENT COMMANDS

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 3464 - August 4, 2014

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


EFFICIENT COMMANDS

I cringe anytime I see someone code
inefficiently. Here are three of the
most common mistakes, followed by a
better way to do the same thing.

Bad: cat somefile | grep something
Better: grep something somefile
Why: You're running one program (grep) instead of two (cat and grep).

Bad: ps -ef | grep something | grep -v grep
Better: ps -ef | grep [s]omething
Why: You're running two commands (grep) instead of three (ps
and two greps).

Bad: cat /dev/null > somefile
Better: > somefile
Why: You're running a command (cat) with I/O redirection,
instead of just redirection.

Although the bad way will have the
same result, the good way is far
faster. This may seem trivial, but
the benefits will really show when
dealing with large files or loops.

Regards.

This tip generously supported by: sec@nbnet.nb.ca


--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================

Sabtu, 02 Agustus 2014

Unix Tip: EXTRACT RELATIVE FROM ABSOLUTE

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 3462 - August 2, 2014

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


EXTRACT RELATIVE FROM ABSOLUTE

Ever had a tar archive which
was tarred up with an absolute
path, but you need to untar
it to a relative location?

There is an easy way to do
this using the "pax" command.
Note: Not available on all
flavors.

Firstly, copy the archive to
the relative location in
which you wish to untar it.

Then, execute the following
command:

pax -r -s ',^/,,' -f file.tar

The contents of file.tar will now
be in the $CWD.



--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================

Jumat, 01 Agustus 2014

Unix Tip: BELIEVE THE VENDOR?

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 3461 - August 1, 2014

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


BELIEVE THE VENDOR?

Don't always feel that you should
believe the vendor.

Patches, vendor recommendations,
and out-sourced hardware support
engineers are some of the leading
causes of breaking a system. There
are times when you know your systems
better then they do.

If something doesn't feel right or
doesn't feel right , don't let them
do it. Ask a lot of questions and let
them know what your experience is.

Cover yourself first, run full
backups, ask them if the have ever
done the task before. Ask them to
confirm the procedure with a back
level support person.

Many times vendors will out-source
the hardware support to third party
companies. When this happens, you
may never get the same person twice,
nor know what experience he has on
your system.

If one of the first things a support
person does is ask where a phone is,
it is almost a guarantee that he will
lack the knowledge he should have and
will need to rely on someone else for
answer. While we all have much work
to do, DON'T LEAVE this type of person
alone with your systems.

Trust no one, it is you job and
reputation on the line.


-Kirk Waingrow

The tip is supported by: kirk@ugu.com


--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================
Your Ad Here
Free Automatic Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink