Tips &Tricks Blog

Toggle back and forth between two directories from the command line 0

Toggle back and forth between two directories from the command line

If you need to continuously switch between two different directories from the command line or in a shell script, this is a super handy command to do just that. cd –

Create n levels of directories with a single command from the terminal 0

Create n levels of directories with a single command from the terminal

On your terminal, use this command to create any number of nested directories in a single command. mkdir -p dir1/dir2/dir3/dir4/dir5

Display contents of a directory as a tree on mac osx 0

Display contents of a directory as a tree on mac osx

Run this command from your mac terminal to display your directory structure as an ascii tree. tree -I If you need to ignore a directory, just mention it in single quotes. tree -I ‘node_modules’

Java – How to Convert character array to a String 0

Java – How to Convert character array to a String

Many a times you need to convert the character array into a String, its quite simple to do. char[] x = {‘s’,’u’,’m’,’i’,’t’}; Method 1. String a = new String(x); Method 2. String b =...