iwconfig/ifconfig
The iwconfig command is used to view or modify the wireless network configuration (mode, rate, frequency/channel, etc.).
The syntax is: iwconfig NAME_OF_WIRELESS_ADAPTER MODIFICATION
For example, to change the name of the wireless network to “myNetwork”on wireless adapter eth0, the command would be: iwconfig eth0 essid myNetwork
The ifconfig command is used to view or modify the network interface and IP configuration for wired connections.
The ifconfig syntax would be: ifconfig NAME_OF_ADAPTER
For example, to view the configuration (such as IP, subnet mask, etc.) on adapter eth0, you would use the command: ifconfig eth0
Some Linux distributions, have changed to using the ip
command instead. So to view information similar to ifconfig
, instead you would use: ip address
Ps
The ps command is similar to the Windows Task Manager. The ps command returns a list of all currently running processes and their process ID (PID).
To view the processes for the current user, use the command: ps
To view all processes use the command: ps -e
su/sudo
Some commands will require elevated rights and this is where the su and sudo commands may come into play.
The command su
is short for super user. It allows you to switch to the root user when you run it with no switches. The root user is similar to the Administrator account on a Windows system.
The command su
with a switch allows you to switch to other user accounts; for example su bob would switch to the bob account.
You will continue to act as that user until you enter the exit
command.
The sudo command is a prefix you add to commands to execute the command with root privileges without actually switching to the root user. As soon as you enter that command, you are back to your normal user and permissions.
apt-get
The apt command stands for Advanced Packaging tool, which is a popular Linux package manager. The command apt-get is used to get missing files. For example you would use the apt-get command to retrieve the Linux graphical shell.
In addition to installing you can also update and remove applications and utilities using the apt-get command.
The syntax to install an application would be: sudo apt-get install APPLICATION
For example to install wireshark would be: sudo apt-get install wireshark
Vi
The vi command will put you into a visual mode editor, so that you can edit files. With vi, you can copy, paste, etc.
To start up the Visual Mode editor the syntax is: vi NAME_OF_FILE
For example to edit failed.txt in visual mode editor, you would enter: vi failed.txt
Once in the editor mode, you’ll need to enter i
in order to insert text. To exit out of insert mode, press the Esc key.
To save and quit vi, you would enter :wq
Dd
The dd command is used to convert and copy a file. It can also be used to backup and restore entire partitions.
The dd syntax looks like: dd if=<source file name> of=<target file name> [Options]
kill
The kill command uses the Terminal command line to terminate an application. The kill syntax looks like: kill <pid>
where <pid> is the process ID of the process you want to terminate.
The killall command will terminate all instances of that application. For example, you could run: sudo killall chrome