<commit_before>## Unix Lecture Notes

- To download from a web page type

  ~~~terminal
  wget link_to_download_location
  ~~~

- To unzip

  ~~~terminal
  unzip file_name.zip (also look up 'tar')
  ~~~

- Print username and current directory

  ~~~terminal
  whoami
  pwd
  ~~~

- ls options

  ~~~terminal
  ls
  ls -F
  ls -a
  ls -l
  ls -h
  ls /
  ls -n
  ls --help
  ~~~

- rm options

  recursive remove

  ~~~terminal
  rm -r directory_name
  rm file_name
  ~~~
  
  Interactive remove: asks permission before deleting

  ~~~terminal
  rm -ri directory_name
  ~~~

  Deleting empty directories

  ~~~terminal
  rmdir name_of_empty_directory
  ~~~

- touch options

  ~~~terminal
  touch file_name
  ~~~

  Changes access time of the existing file. If the file does not exist, it creates an empty file

  Reasons to use touch:
  - Avoiding text editor
  - Updates time stamp

- word count : lines, words, characters

  ~~~terminal
  wc *.extension
  wc file_name
  ~~~ 

  Flags: -l (lines) -w (words) -c (characters)

- store output to another file

  ~~~terminal
  wc -l file_name > output_filename.txt
  ~~~

- head vs cat vs tail

  'head' prints only first 10 lines, 'cat' print everything
  'tail' prints the last 10 lines

   also look - less, sort, tee

- pipes
  
  ~~~terminal
  wc -l *.pdb | sort -n
  ~~~
  sort the output of first command numerically

  ~~~terminal
  wc -l *.pdb | sort -n | head -n 1
  ~~~
  sort the output of the first command and print the first line
   
  ~~~terminal
  screen
  mpirun -n 4 ./exec_file | tee output.txt
  ~~~

  add output to file

  ~~~terminal
  echo hello > hello.txt
  ~~~

  append to file

  ~~~terminal
  echo hello >> hello.txt
  ~~~

- loops

  ~~~terminal
  for filename in *.dat
  > do
  >      echo $filename
  >      echo 
  >      head -n 100 $filename | tail -n 5
  > done
  ~~~

- git status outside working directory

  ~~~terminal
  git --git-dir=/home/akash/Github/ParaSolve_AMR/.git --work-tree=/home/akash/Github/ParaSolve_AMR status
  ~~~


## Python Lecture Notes

- If %matplotlib inline is not working, then restart kernel by typing

  ~~~terminal
  ipython notebook --pylab=inline
  ~~~
<commit_msg>Adding notes for GIT SC<commit_after>## Unix Lecture Notes

- To download from a web page type

  ~~~terminal
  wget link_to_download_location
  ~~~

- To unzip

  ~~~terminal
  unzip file_name.zip (also look up 'tar')
  ~~~

- Print username and current directory

  ~~~terminal
  whoami
  pwd
  ~~~

- ls options

  ~~~terminal
  ls
  ls -F
  ls -a
  ls -l
  ls -h
  ls /
  ls -n
  ls --help
  ~~~

- rm options

  recursive remove

  ~~~terminal
  rm -r directory_name
  rm file_name
  ~~~
  
  Interactive remove: asks permission before deleting

  ~~~terminal
  rm -ri directory_name
  ~~~

  Deleting empty directories

  ~~~terminal
  rmdir name_of_empty_directory
  ~~~

- touch options

  ~~~terminal
  touch file_name
  ~~~

  Changes access time of the existing file. If the file does not exist, it creates an empty file

  Reasons to use touch:
  - Avoiding text editor
  - Updates time stamp

- word count : lines, words, characters

  ~~~terminal
  wc *.extension
  wc file_name
  ~~~ 

  Flags: -l (lines) -w (words) -c (characters)

- store output to another file

  ~~~terminal
  wc -l file_name > output_filename.txt
  ~~~

- head vs cat vs tail

  'head' prints only first 10 lines, 'cat' print everything
  'tail' prints the last 10 lines

   also look - less, sort, tee

- pipes
  
  ~~~terminal
  wc -l *.pdb | sort -n
  ~~~
  sort the output of first command numerically

  ~~~terminal
  wc -l *.pdb | sort -n | head -n 1
  ~~~
  sort the output of the first command and print the first line
   
  ~~~terminal
  screen
  mpirun -n 4 ./exec_file | tee output.txt
  ~~~

  add output to file

  ~~~terminal
  echo hello > hello.txt
  ~~~

  append to file

  ~~~terminal
  echo hello >> hello.txt
  ~~~

- loops

  ~~~terminal
  for filename in *.dat
  > do
  >      echo $filename
  >      echo 
  >      head -n 100 $filename | tail -n 5
  > done
  ~~~

- git status outside working directory

  ~~~terminal
  git --git-dir=/home/akash/Github/ParaSolve_AMR/.git --work-tree=/home/akash/Github/ParaSolve_AMR status
  ~~~


## Python Lecture Notes

- If %matplotlib inline is not working, then restart kernel by typing

  ~~~terminal
  ipython notebook --pylab=inline
  ~~~

## Git Lecture Notes

- git remote set-url origin <newurl>
{'fraction_non_alphanumeric': 0.10678080648794773, 'fraction_numerical': 0.004505519261094841, 'mean_word_length': 2.535031847133758, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7629676', 'n_tokens_mistral': 1699, 'n_tokens_neox': 1431, 'n_words': 538}