
Very often, for those who approach Linux servers for the first time, there are a little embarrassment. There is no graphic interface, but only a textual control shell. So here is a list of CentOS commands useful for those who want to approach Linux servers, CentOS distribution.

First, to access the server command shell, you can do it in two ways:
- directly from the server keyboard (even virtual)
- via SSH by means of ExtraPuTTY type clients
How to juggle the command shell
To access the Centos server, I far prefer to do it via SSH client, as extraputty. To get the on, you need to know the server address, use Porta 22, get to know username (typically root) and your password.

After gaining access, you can start using the first useful Centos commands.

Copy/Paste. ExtraPuTTY for Windows allows you to paste commands already present in the clipboard, simply by pressing the right mouse button. This is a nice convenience.

Clean the screen: type Ctrl+L.
Manage folders and files in CentOS
To manage the files, I recommend using specific software, such as WinSCP, which allows you to access via SSH to the CentOS server and handle the files like a normal file explorer. Alternatively, you can use the following commands.
Determine the current folder
pwd
Change the current folder

cd sottocartella cd /cartella
List of files in the current folder
ls
List files with size, date, time, and properties
ls -lh
List of subfolders of the current folder
ls -d */
Available space on the disks
df -h
List of subfolders of the current folder, with their size
du -kscxh */
Find a file in the current folder or subfolders
find . -name nome_file_esatto.ext find . -name "*nome_con_wildcards*"
Use the quotes if you do not know the exact name and you want to use the asterisk *.
Find a file throughout the hard disk
find / -name nome_file_esatto.ext find / -name "*nome_con_wildcards*"
Download a file from the internet
wget http://www.indirizzo.it/nome_file.ext
Take ownership of a folder and all files and subfolders contained in it
chown -R nome_utente /cartella
CentOS server update
Updates are periodically released for packages that are installed on the server. Then type the following command to update all installed packages:
yum update

When the list of packages to be updated appears, press y to confirm, n To cancel. To confirm the update without having to press y, you can use the following command:

yum update -y
The update procedure is generally quite safe. If a package was damaged, the update could also be canceled for the other packages. In this chaste, it is necessary to exclude the package from the update that gives problems, with the following command:
yum --exclude=pacchetto_da_escludere* update
If you know the exact name, you can omit the asterisk *, alternatively, type part of the name and use the asterisk to complete a yum the name of the package to exclude.
Add or remove software
Add a package
yum install nome_del_pacchetto
In order to install a package, you must have the repository installed in /etc/yum.repos.d/
Remove a package
yum remove nome_del_pacchetto
Other useful CentOS commands: exim (mail transfer agent)
This list of CentOS commands is useful for understanding the status of exim (mail transfer agent).

Message queue list
exim -bp
Message queue count

exim -bp | exiqsumm
Number of messages in the queue
exim -bpc
What is exim doing now?
exiwhat
List of all configuration parameters
exim -bP
View a specific configuration parameter (e.g. queue_run_max)
exim -bP queue_run_max
Other useful CentOS commands: php
View the version of php
php -v
