Monday, May 20, 2013

Few must know unix commands

After spending more than 9 years of my life in microsoft os,  I feel great now to use my Mac notebook.  Especially I have fallen in love with the terminal and thrilled to learn the power of unix.  I curse myself for not being an unix user so far. Well, its never late to start. :-)

As a beginner I thought of sharing my learnings to my fellow unix beginners with few basic commands that you "must" know as an unix user.

Few basic "must" know unix commands

1. ls - list files and folders

What is ls?  A command to list all files and folders in a directory.
Usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]

Explaining few commonly used parameters of lsls command args

2. pwd - present working directory

What is pwd?  A command to display the present working directory path.
Usage: pwd

3. chmod - file permissions changer

What is chmod?  A command to display the present working directory path.
Usage:  chmod arguments file
Permissions to a file can be of the following three categories,
  1. Read
  2. Write
  3. Execute
Let me try explaining this using numeric permissions,

Read

400 - read permission to owner
040 - read permission to group
004 - read permission to anybody

Write

200 - write permission to owner
020 - write permission to group
002 - write permission to anybody

Execute

100 - execute permission to owner
010 - execute permission to group
001 - execute permission to anybody

All permissions are in 3 digits,
xyz - indicates owner
xyz - indicates group
xyz - indicates anybody

For example:
chmod 777 filenmae means read-write-execute (full) permissions for anybody to the file.
chmod 644 filename means read and write permission to owner and read access to rest of the users to the file specified.
chmod 755 filename means read-write-execute permissions to owner and read and write access to others for the specified file.

The best way to learn any unix command is to do a "man" of that command.  For ex: man ls


Thursday, May 16, 2013

Git for beginners

Getting started with Git

I would advise to read through what is Git, and have a decent understanding of SCM process.
The first question everyone would get is why I should move away from my current SCM systems(CVS or SVN).  Well there are lot of articles around this topic if you google,  just a couple of quick reasons I would give to go with Git,
  1. Works the best if you are working decentralized.
  2. Stop questioning and just "Go with the flow" :-), git is grabbing more focus recently especially after GitHub's strong support.

Lazy comparison of Git vs SVN commands

I thought a simplest way is to compare Git vs SVN was through the basic commands used for day-to-day development.  Though we use the UI tools for regular activities, I am listing down the comparison by commands (lazy).

Git vs SVN commands
Git vs SVN commands
Two notable operations are the checkout and commit.  For any Git operations "clone" is a prerequisite, so to do a checkout initially you must clone the repository. If you notice a commit is not an actual commit to the repository instead it is to your local.  You need to do an explicit push to the repo after a successful commit. Remember everything happens in your local and not in your repo.

Tuesday, May 7, 2013

What is maven batch mode

Maven batch mode

Batch mode is to run Maven in a non-interactive, continuous integration environment. When running in non-interactive mode, Maven will never stop to accept input from the user. Instead, it will use default values when it requires input.

How to run maven in batch mode

Pass one of the params below to mvn command from your terminal,

--batch-mode, B

Monday, May 6, 2013

How to rename a file or folder in mac

Rename a file or folder in mac

If you were a windows user and new to mac, you would wonder how to rename a file in mac.  

The first thing you would try to do is a function f2, which wouldn't have helped.  The next effort you would have taken would be to do a cntrl click to look through the options.  That wouldn't have helped either.  May be you would have then tried "duplicate" or "alias" option and vent in vein.

Select the file or folder you want to rename and press enter key,  here you go now your will be able to  rename.