Live Chat!

Discover user guides and manuals within your linux system

          0 votos

May 9th, 2008 mysurface

Do you realized that we can obtain a lots of user manuals and guideline documents from our system? There is a folder /usr/share/doc, you may find some useful docs already preinstalled by your distro. Those docs are in pdf or html format. I manage to find user manuals for valgrind, ipython, systemtap, boost etc.
I believes [...]

Posted in Common, echo, find | Hits: 18427 | 2 Comments »

Generating Random numbers

* * * * * 1 votos

October 27th, 2006 mysurface

We can obtain pure random (NOT pseudo-random) bytes from /dev/random. Linux kernel harnesses a good source of randomness from you. The random bytes in /dev/random is measuring based on the time delay between your input actions.
so seems /dev/random provided random bytes, we need to turn the bytes into an integer so that we could read. [...]

Posted in Bash, Misc, echo, od, touch | Hits: 7071 | No Comments »

if … then … fi

* * * * * 2 votos

October 13th, 2006 mysurface

if iis a basic programming checking for condition and reacts based on the condition, bash uses if to check for

File
integer
String

For checking the File, let say your file name is stored at $fn, and you wanna check the file is exist ? do this:

if [ -e $fn ]
then
echo “$fn exist.”
else
echo “$fn does not exist.”
fi
Bellow are [...]

Posted in Bash, Misc, echo, if | Hits: 6825 | No Comments »

word count

          0 votos

September 17th, 2006 mysurface

Word count is a very common tools that used to calculate number of lines, words and characters. For example if I can do this
echo “hello world.” | wc
1 2 13
The result indicate that there are 1 line, 2 words and 13 characters.
You can output [...]

Posted in Common, cat, echo, wc | Hits: 6095 | 1 Comment »

check for error number

          0 votos

September 1st, 2006 mysurface

Error or no success running a command always return a number, usually it will return 0 unless it occurs an error. To check what error number it returns, do this after command is done.
echo $?
To test this, simply ls something doesn’t exist, then it will return value 2. Sometimes, you can obtain the error number, [...]

Posted in Developer, echo, perror | Hits: 2950 | No Comments »

Setting Environment Variable

          0 votos

August 29th, 2006 liewsheng

You may wonder how you knowing the hostname or machine type you are log in. Actually we have a lot way to do so, one of them is print out the environment variable set. How we can set this variable? export is the command used in bash shell, example:
export VARIABLE_NAME=”any data you want to put [...]

Posted in echo, export | Hits: 4943 | 1 Comment »