Archive for the ‘BASH’ Category

List GIT Failed Automatic Merge Files Only

Thursday, March 29th, 2012

If you just did a merge in GIT and had some automatic merge failures, you can use git status -s to see all updates with unmerged errors marked as U or you can run the following command and just show those files that failed on merge.

git diff --name-status --diff-filter=U

Count Number of Lines of Code in a Project

Tuesday, December 20th, 2011

find ./ -name \*.js | xargs wc

[find] [in this current directory] [files named] ["wildcard".js] [and] [just print counts]

The first column is the number of lines for the listed file, with the total count at the bottom.  As you can tell, I’m working on a JavaScript project.

BASH, C-Shell, etc.

Wednesday, September 28th, 2011

I was trying to figure out how to change my default shell from CSH to BA$H for my ODU CS login after doing some customization on my .bashrc file. If you’re in the same boat as me, a few simple changes will take care of things. This can all be done without root access.

  • $ echo $SHELL # find out what shell you are currently using, gives me something like /usr/local/bin/tcsh
  • bash # to switch to a BA$H terminal. exit to your csh
  • If a csh ~/.login doesn’t exist, create one and put the command exec bash in it. You could also use the full path to the shell you want to use
  • Run source ~/.login to restart your csh with the new rule… it should skip you over to bash instantly

This got me far enough to get a terminal but not far enough to use Vi as I would like to and expect to. I use Putty, since most of the time I have to be on a Windows computer. Times are changing though and hopefully soon I can drop it entirely in favor of Ubuntu. If you are having trouble with numbers, arrow keys, the insert key, etc. try some of these helpful hints:

  1. Open putty and load your session
  2. Go to terminal -> features and check “disable application keypad mode”
  3. echo $TERM and make sure that Putty and your server are using the same type. vt100 is the most common
  4. set term/device=vt100
  5. Load your Putty session and go to Connection -> Data and enter “vt100″ (without quotes) or whatever type you decided on. Optionally you can enter your username here as well so you only type your password on login.
  6. Under Terminal -> Keyboard, set “Ctrl-H”, “Standard”, “ESC[n~”, and the default for everything else on that panel
  7. For the rest, follow the directions here.

… this is still a post in progress. Sadly, I’m still not working with a full deck of Vi.

Enjoy!


©2005-2017 Blog – Epiphany Digital is proudly powered by Badgers and Web Design is by Epiphany Digital
Entries (RSS) and Comments (RSS). 36 queries. 2.058 seconds.

Thank you for visiting this site. The web fairy will visit you in your sleep... you know, I was going somewhere with this, but it really doesn't have as much innocent charm as the tooth fairy, especially when I picture the web fairy as someone much like the Simpsons' Comic Book Guy but with wings. It's just not something I want.