Group 25 Marauders

(Shaan Vaidya 150050004) (Abhishek Kumar 150050020) (Vishwajeet Singh Bagdawat 150050046)

I pledge on my honour that I have not given or received unauthorised assistance on this assignment or any previous task. -Shaan

I pledge on my honour that I have not given or received unauthorised assistance on this assignment or any previous task. -Abhishek

I pledge on my honour that I have not given or received unauthorised assistance on this assignment or any previous task. -Vishwajeet

Contribution:
Shaan : 100% 
Abhishek: 100%
Vishwajeet: 100%

Citations:
www.tutorialspoint.com/unix_commands/ 
	- grep, tr, cut etc.
https://support.suso.com/supki/SSH_Tutorial_for_Linux 
	- ssh 
http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/internet/node31.html 
	- ssh-keygen (generate ssh key)
http://linux.die.net/man/1/ssh-copy-id 
	- ssh-copy-id (copy the key to remote server) 

Extra credits attempted:
Task A 5
Task C 4

Task A:
Bash manages autocomplete using 'readline' library which in turn provides functions for applications that allow users to edit command lines.
When tab is pressed, readline calls back to bask which in turn returns a list of possible completions. Readline then inserts as many characters that are common for all functions.
Bash also has a builtin 'complete' function to define how to complete commands. First it matches with commands, if nothing then file names. One can also customise this.
Bash also stores history and stores size in HISTSIZE variable. Can be seen using history.

Task B:
'meminfo' file in the /proc directory contains information regarding memory usage

Command used for the task:
grep -w 'MemTotal\|MemFree' meminfo | tr -d " " | cut -d \: -f 2 

	grep searches for the words (-w option) MemTotal and MemFree in meminfo. \| is used to escape the pipe operator as 'or'. 

	tr translates the data. -d option with " " argument removes spaces.

	cut -d separates the data by delimiter ':'. -f option helps select data fields in output which is '2' in this case. 



Task C:
Command used for 'ssh'ing : ssh shaan@mars.cse.iitb.ac.in
Command used for graphical output on local machine: ssh -X shaan@cse.iitb.ac.in
	-X option enables X11 forwarding onto the local machine


Task D:
./infiniteLoop.sh & 
OR
source infiniteLoop.sh &
	'&' runs the script in the background directly; instead one could use bg to throw the process to background. (source infiniteLoop.sh was used as the alternative gave a 'permission denied' error) We looked this up on the internet

ps -aux | grep infiniteLoop.sh 
	- get pid
kill [process-id]
OR
pkill [script-name]

	We started with bringing the process to foreground and then kill it but obviously it was wrong as it killed all fg processes. So we used kill [process-id] but that required to first look up the process-id using 'ps -aux' piped with grep.
	pkill [script-name] kills the process started by the script whose name we passed as argument.






