Monday, September 13, 2010
Monday, April 6, 2009
Unix command to find size of the folder in human readable format
du -sh
For further options visit : http://www.linfo.org/du.html
Monday, March 9, 2009
Looping Through Numbers with Blocks and Iterators
5.times do puts "Test" end
1.upto(5) { ...code to loop here... }
10.downto(5) { ...code to loop here... }
0.step(50, 5) { ...code to loop here... }
The first example counts from 1 “up to” 5. The second example counts from 10 “down
to” 5. The last example counts up from 0 to 50 in steps of 5, because you’re using the step
method on the number 0.
1.upto(5) { ...code to loop here... }
10.downto(5) { ...code to loop here... }
0.step(50, 5) { ...code to loop here... }
The first example counts from 1 “up to” 5. The second example counts from 10 “down
to” 5. The last example counts up from 0 to 50 in steps of 5, because you’re using the step
method on the number 0.
Sunday, February 22, 2009
Unix/Linux find command tutorial
The Best tutorial and reference for Unix/Linux find command. Please follow the link :
http://content.hccfl.edu/pollock/Unix/FindCmd.htm
http://content.hccfl.edu/pollock/Unix/FindCmd.htm
Friday, February 6, 2009
Read form data using Perl
#!/usr/bin/perluse strict;
my $formdata;
read(STDIN,$formdata,$ENV{CONTENT_LENGTH});
print "Content-type: text/html\n\n";
#Add html codes..
for( split(/&/,$formdata) ){
$_ =~ tr/+/ /;
my ($n,$v) = split(/=/,$_,2);
$n =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$v =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
print "$n=$v\n";}
print 'add closing html codes';
my $formdata;
read(STDIN,$formdata,$ENV{CONTENT_LENGTH});
print "Content-type: text/html\n\n";
#Add html codes..
for( split(/&/,$formdata) ){
$_ =~ tr/+/ /;
my ($n,$v) = split(/=/,$_,2);
$n =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$v =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
print "$n=$v\n";}
print 'add closing html codes';
Tuesday, November 18, 2008
Linux Basic Commands
how do I get the line, word, or character count of a fine in UNIX?
wc
Replacewith the file or files for which you want information. For each file, wc will output three numbers. The first is the line count, the second is the word count, and the third is the character count. For example, if you entered wc .bashrc, the output would be something similar to the following:
13 23 709 .bashrc
The options are:
wc -l - by lines
wc -w - by words
wc -c - by bytes
wc
Replace
13 23 709 .bashrc
The options are:
wc -l
wc -w
wc -c
Tuesday, October 14, 2008
Subscribe to:
Posts (Atom)