MANDATORY_Commands_Need2Know


 * Whenever you are the superuser, the prompt will show a # instead of a $.**

**Unix actually keeps track of users by their user identification number (UID). Giving an account a UID of 0 (zero) gives the account all of the same privileges as the root user. The UID number of a superuser login is 0.**

You can always find your current directory by typing : **pwd**.

Grep

**grep** : is an extremely useful Unix command that allows you to look for a specific word or phrase in one or more files. The command is actually an acronym for global regular expression print.
In English, this command says something like, "Look through the file **/etc/services** and print out every line that contains ** name **.
 * $: grep name /etc/services **

$ grep -i name /etc/services
Because Unix is case sensitive, it will not find any lines that contain **Name** (with a capital N). You can tell **grep** to ignore the case by using the **-i** flag. =>>>>>>>>>>>=
 * dpkg** to review all installed set of software packages on a system. Delete all unwanted packages.:

Command: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 * 1) **dpkg --list**
 * 2) **dpkg --info** packageName
 * 3) **apt-get remove** packageName

Make Sure No Non-Root Accounts Have UID Set To 0:
Command:
 * 1) **awk -F: '($3 == "0") {print}' /etc/passwd**

You should only see one line as follows: If you see other lines, delete them or make sure other accounts are authorized by you to use UID 0. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 * root:x:0:0:root:/root:/bin/bash**

Command: To disable service: Command: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 * T ** o see services which are started at boot time in run level # 3:
 * 1) **chkconfig --list | grep '3:on'**
 * 1) **service serviceName stop**
 * 2) **chkconfig serviceName off**

To list all open ports and associated programs: Command:
 * 1) **netstat -tulpn**