Friday, December 28, 2012

retriving user .folder on ubumtu

Ubuntu : I surprised after finding some data in my pen drive on ubuntu. I was copied folder prefixed of dot( "." [e.g] .m2) from my windows 7 laptop. But it was missing when plugged ubuntu. I was very confident with what I have been copied. So, I thought of finding it with google as ".folder in ubuntu".

I found a link,
http://www.cyberciti.biz/faq/explain-linux-unix-dot-files/

"A dot file is nothing but a configuration file usually stored in users home directory."

from the above line I got the nice information that ubuntu storing all the configuration data inside the .file and .folder

E.g to view the .folders

$ ls -a
$ ls -ld .*
$ ls -a | grep '^\.'


But here the point I don’t want to last my folder which is copied already.So I chooses to go with terminal (command prompt). He never pushed me down.

$cd .m2 

Using the above command I able to be inside the .m2 . So the problem solved, with coping the data from the current directory.

$ls 

output:
repository

The $ls command shown me the subdirectories of current path.

$cp -r repository ../

after using the copy command I got the subdirectory outside of the .m2 folder.

Note: I used the -r argument for the copy command because my subdirectory have some more subdirectory inside.

If you not interested with doing all this with terminal, switch with shortcut

On your window click,

ctrl+L (Goto Location)

and type the path of your hidden folder.









Tuesday, December 11, 2012

Linux Error & Hot Fix

If this is your Linux terminal error
-------------------------------------------------------------------------------------------------------------------------------------
Command 'lesspipe' is available in the following places
 * /bin/lesspipe
 * /usr/bin/lesspipe
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.
lesspipe: command not found
Command 'dircolors' is available in '/usr/bin/dircolors'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
dircolors: command not found
Command 'uname' is available in '/bin/uname'
The command could not be located because '/bin' is not included in the PATH environment variable.
uname: command not found
bash: [: =: unary operator expected
Command 'sed' is available in '/bin/sed'
The command could not be located because '/bin' is not included in the PATH environment variable.
sed: command not found
Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.
ls: command not found

-------------------------------------------------------------------------------------------------------------------------------------

Hot Fix:
Do the following command in the same error terminal
 -------------------------------------------------------------------------------------------------------------------------------------
  export PATH=/usr/bin:/bin

Merging two sorted arrays - Big O (n+m) time complexity

 Problem :  Merge the two sorted arrays. Edge case :  Array can empty Arrays can be in different size let getMaxLength = ( input1 , input...