Tagged: terminal

0

Find hostname in mac

Run the following command in your terminal. echo $HOSTNAME It is the simplest way to find the hostname in MAC from your terminal.

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’