Monday, March 24, 2008

File Count in a Folder

Recently I found a command that displays the Number of files in a ls command listing: Code: ls -l | wc -l Above will find the number of files in a directory, and it will send o/p as pipe to the wc -l, which outputs the number of lines in its input. To display all file including hidden and dot files, try Code: ls -lA | wc -l

Friday, March 14, 2008

Stripping white space

s = s.replaceAll(" +", ""); Here is the String BFI NS-16 after the replace BFINS-16