I pledge on my honour that i have not used any unauthorized help in this task and any of my previous tasks. - Ayush
I pledge on my honour that i have not used any unauthorized help in this task and any of my previous tasks. - Umesh
I pledge on my honour that i have not used any unauthorized help in this task and any of my previous tasks. - Ankan
Task A:
# enable bash completion in interactive shells
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
We found this code as a part of bashrc files.
As the user hit the tab , a program . /usr/share/bash-completion/bash_completion or . /etc/bash_completion runs which autocompletes.
Task B:
filename : meminfo
Commands:
grep "Mem" meminfo
grep "Mem" meminfo | tr -d ' '
grep "Mem" meminfo | tr -d ' ' | cut -d':' -f2
Task C:r
SSH to mars account:
ssh ayushraj@mars.cse.iitb.ac.in
ssh -X ayushraj@mars.cse.iitb.ac.in :
to run sublime text through a terminal on a GUI
Task D:
After writing the code , we entered in the folder containing the code through terminal . Then we tried to run the code , but it didn't work . Then we recalled your lecture and then found the command to make it executable. Then we run "./infiniteLoop.sh &" as was mentioned in the link in the inlab page. From the same page we got to know about "jobs" command that tells the about the running or killed processes. We found that the program was still running in the background and then we tried "ps" and got to know the process ID of the program. We tried kill infiniteLoop.sh but it flagged an error , then we tried with the process ID and it worked !
For cell.sh we tried kill PID and got "Wake me up when you've become stronger" as message . We checked in the code and its number was 9 and by getting hints from other sites we tried kill -9 PID and it worked.
Commands Used:
chmod +x infiniteLoop.sh // For making the file executable
./infiniteLoop.sh & // Running the executable in background
ps //For getting the PID for the process
kill PID // where PID is the ID of the process that we want to kill