Linux

Installing programs in Linux
First, to update your system:
Open up a terminal window by going to: Applications>Accessories>Terminal type:
sudo apt-get update then type:
sudo apt-get install build-essential Do an internet search.
What are the update and build-essential packages are used for?
What is the difference between apt-get and apt-get install?
Apt-get will fetch the package
Next from Firefox, download nmap-5.00.tar.bz2 from http://nmap.org/dist/nmap-5.00  to your desktop.   Make sure you select save (this will send it to your Desktop).  Then right click and rename it so that includes the extension  .tar.bz2 (at the end of the nmap-5.00).
Return to your terminal window Type:
pwd
What is your current location?  Example:  /home/yazan Type:
sudo mkdir /myProgs
cd /   (you need a space between the command and location /)
What happened?  What did sudo mkdir /myProgs do?
Type:
sudo mv Desktop/nmap-5.00.tar.bz2 /myProgs/  (again you need a space before /)
minimize the terminal window
Is the file that you saved to the desktop gone?
In the terminal window, type:
cd /myProgs
What did this do?
Type:
ls –l  (don’t forget the space)
Now unpack the bz2 file and unarchive the tar-file, by typing:
sudo bunzip2 nmap-5.00.tar.bz2
sudo tar xf nmap-5.00.tar
If you want to look inside /myProgs/nmap-5.00 to see the files (without changing directories), what will you type

Now type:
cd nmap-5.00
more INSTALL | wc -l
What do you see? The number 10.
What is this command is doing?  What does this do?
What is this doing? Checking for the build system, host system and compiler type to ensure compatibility.
What does the make command do? It is a script that runs the compiler to compile the software/source code.
What is this doing? Installs the software just compiled into the correct directories and edits menus and paths as necessary so that the compiled packages work correctly.
Why would you do this?  To delete the nmap-5.00 directory and files. What does rm do? Removes files and directories.
What is the name of the compiler that works with C? gcc
How about C++? g++
What is a compiler? A compiler reads program language code and creates a binary based upon the programmed code. Translates the code to machine language.
What is nano? Nano is a text editor.
What did you do? The command compiled the program I just wrote and saved as myProg.cpp
Why do you have to type sudo? Because elevated permissions are needed to execute the file.
What result do you get? A $ appears.
Explain what echo $?  Does  – The echo command displays whatever is given as input to standard output so $ was displayed to standard output.