### All commands (14,018) the last day the last week the last month all time sorted by date votes

• -24
cd
· 2009-03-23 03:12:40

• -24
touch balls
· 2009-02-20 19:56:59

• -24
cd
· 2010-08-06 05:33:19

• -24
l
· 2010-09-09 23:26:27

• -24
ls -l ~
· 2010-09-12 10:55:00

• -24
ls -l \$HOME
· 2010-09-12 10:56:13

• -25
ls -la
· 2009-04-13 20:37:25
• Convert Windows/DOS Text Files to Uni Show Sample Output

-26
Convert Windows/DOS Text Files to Uni
· 2009-10-24 18:41:35

• -26
w3m
· 2009-02-20 07:22:07

• -27
perl -e 'print "Hello World!", "\n";'
· 2009-03-24 14:58:01
• This command install Apache 2 and other utilities on CentOS

-31
yum install httpd
· 2009-02-19 16:59:51
• I am using .bat commands to execute Curl commands for Twitter API Show Sample Output

-34
test.bat parm1 parm2 parm3
· 2009-03-25 12:27:18
• Useful to quickly get back to the Windows root directory of the current drive from a sub-directory within that drive. Works also without space between 'cd' and backslash: 'cd\' or 'cd \' have the same effect Show Sample Output

-34
cd \
· 2009-02-14 21:53:51

• -44
ipconfig /all
· 2009-03-06 17:36:07

• -73
· 2009-11-09 20:26:50
• EDIT: Trolling crap removed ;) takes approx 6 secs on a Core 2 Duo @ 2GHz, and 15 secs on atom based netbooks! uses monoid (a,b).(x,y)=(ax+bx+ay,ax+by) with identity (0,1), and recursion relations: F(2n-1)=Fn*Fn+F(n-1)*F(n-1) F(2n)=(Fn+2*F(n-1))*Fn then apply fast exponentiation to (1,0)^n = (Fn,F(n-1)) . Note that: (1,0)^-1=(1,-1) so (a,b).(1,0) = (a+b,a) and (a,b)/(1,0)=(a,b).(1,0)^-1=(b,a-b) So we can also use a NAF representation to do the exponentiation,http://en.wikipedia.org/wiki/Non-adjacent_form , it's also very fast (about the same, depends on n): `time echo 'n=1000000;m=(n+1)/2;a=0;b=1;i=0;while(m>0){z=0;if(m%2)z=2-(m%4);m=(m-z)/2;e[i++]=z};while(i--){c=a*a;a=c+2*a*b;b=c+b*b;if(e[i]>0){t=a;a+=b;b=t};if(e[i]<0){t=a;a=b;b=t-b}};if(n%2)a*a+b*b;if(!n%2)a*(a+2*b)' | bc` Show Sample Output

-134
time echo 'n=1000000;m=(n+1)/2;a=0;b=1;i=0;while(m){e[i++]=m%2;m/=2};while(i--){c=a*a;a=c+2*a*b;b=c+b*b;if(e[i]){t=a;a+=b;b=t}};if(n%2)a*a+b*b;if(!n%2)a*(a+2*b)' | bc
· 2009-09-10 09:00:44
• Calculates nth Fibonacci number for all n>=0, (much faster than matrix power algorithm from http://everything2.com/title/Compute+Fibonacci+numbers+FAST%2521 ) n=70332 is the biggest value at http://bigprimes.net/archive/fibonacci/ (corresponds to n=70331 there), this calculates it in less than a second, even on a netbook. UPDATE: Now even faster! Uses recurrence relation for F(2n), see http://en.wikipedia.org/wiki/Fibonacci_number#Matrix_form n is now adjusted to match Fn at wikipedia, so bigprimes.net table is offset by 1. UPDATE2: Probably fastest possible now ;), uses a simple monoid operation: uses monoid (a,b).(x,y)=(ax+bx+ay,ax+by) with identity (0,1), and recursion relations: F(2n-1)=Fn*Fn+F(n-1)*F(n-1) F(2n)=Fn*(2*F(n-1)+Fn) then apply fast exponentiation to (1,0)^n = (Fn,F(n-1)) . Note that: (1,0)^-1=(1,-1) so (a,b).(1,0) = (a+b,a) and (a,b)/(1,0)=(a,b).(1,0)^-1=(b,a-b) So we can also use a NAF representation to do the exponentiation,http://en.wikipedia.org/wiki/Non-adjacent_form , it's also very fast (about the same, depends on n): `time echo 'n=70332;m=(n+1)/2;a=0;b=1;i=0;while(m>0){z=0;if(m%2)z=2-(m%4);m=(m-z)/2;e[i++]=z};while(i--){c=a*a;a=c+2*a*b;b=c+b*b;if(e[i]>0){t=a;a+=b;b=t};if(e[i]<0){t=a;a=b;b=t-b}};if(n%2)a*a+b*b;if(!n%2)a*(a+2*b)' | bc` Show Sample Output

-135
time echo 'n=70332;m=(n+1)/2;a=0;b=1;i=0;while(m){e[i++]=m%2;m/=2};while(i--){c=a*a;a=c+2*a*b;b=c+b*b;if(e[i]){t=a;a+=b;b=t}};if(n%2)a*a+b*b;if(!n%2)a*(a+2*b)' | bc
· 2009-09-10 08:58:47
• The end of unix time and the 32bit era will be Tue Jan 19 03:14:07 UTC 2038 . `date -ud @\$[2**31]` date: invalid date `@2147483648' . In 64bit you have much longer, at least to: `date -ud @\$[2**55]` `Sun Jun 13 06:26:08 UTC 1141709097` Show Sample Output

-148
date -ud @\$[2**31-1]
· 2009-09-11 08:48:50
• ‹ First  < 559 560 561

### What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

### Check These Out

print all except first collumn

List of commands you use most often
Plot your most used commands with gnuplot.

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="\$1" D=\$(( SS / 86400 )) H=\$(( SS % 86400 / 3600 )) M=\$(( SS % 3600 / 60 )) S=\$(( SS % 60 )) [ "\$D" -gt 0 ] && echo -n "\${D}:" [ "\$H" -gt 0 ] && printf "%02g:" "\$H" printf "%02g:%02g\n" "\$M" "\$S" }

Search some text from all files inside a directory

Kill most recently created process.
Kills the most recently created firefox process.

Display 16 largest installed RPMs in size order, largest first
Interesting to see which packages are larger than the kernel package. Useful to understand which RPMs might be candidates to remove if drive space is restricted.

Copy the contents of one partition to another

Migrate existing Ext3 filesystems to Ext4
Before doing this, back-up all data on any ext3 partitions that are to be converted to ext4. After running previous command you MUST run fsck, is needed to return the filesystem to a consistent state. \$ fsck -pDf /dev/yourpartition Edit /etc/fstab and change the 'type' from ext3 to ext4 for any partitions that are converted to ext4.

FizzBuzz in Perl
Just another FizzBuzz in Perl.

Removes file with a dash in the beginning of the name

### Stay in the loop…  