Useful Linux commands, CentOS, server administrator, SSH, server auditor, ExtraPutty

Useful CentOS Commands for Server Administrators

Read in: IT 🇮🇹   EN 🇺🇸

ServerAuditor logo, SSH, Linux, CentOS, CentOS commands useful for Server Administrators

Molto spesso, per chi si approccia per la prima volta ai server Linux, c'è un po' di imbarazzo. Non c'è interfaccia grafica, ma solo una shell di comandi testuale. So here is a list of CentOS commands useful for those who want to approach Linux servers, CentOS distribution.

Subscribe my YouTube channel ValorosoIT. Retro technology, vintage audio, retro computers, experiments and tests. Retroprogramming, Basic. Commodore, IBM, Atari, Apple, Texas Instruments, Amstrad, MSX.

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

Per accedere al server CentOS, preferisco di gran lunga farlo tramite client SSH, come ExtraPuTTY. Per ottenere l'acceso è necessario conoscere l'indirizzo del server, utilizzare la porta 22, conoscere username (tipicamente root) and your password.

ExtraPutty, SSH, Linux, CentOS, connection setup, port 22

Dopo aver ottenuto l'accesso, è possibile iniziare ad utilizzare il primi comandi CentOS utili.

ExtraPutty, SSH, port 22, Linux, CentOS, commands, root login

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

Follow me on Instagram channel. Retro technology, Commodore, vintage audio, retro computers, experiments and tests. Retroprogramming, Basic. Commodore, IBM, Atari, Apple, Texas Instruments, Amstrad, MSX.

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*"

Usare le virgolette se non si conosce il nome esatto e si vuole utilizzare l'asterisco *.

Trovare un file in tutto l'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
CentOS, 6.5, Linux, server, installation, distribution, CentOS commands useful for Server Administrators

When the list of packages to be updated appears, press y to confirm, n per annullare. Per confermare l'aggiornamento senza dover premere y, you can use the following command:

Follow me on Instagram channel. Retro technology, Commodore, vintage audio, retro computers, experiments and tests. Retroprogramming, Basic. Commodore, IBM, Atari, Apple, Texas Instruments, Amstrad, MSX.

yum update -y

La procedura di aggiornamento è generalmente piuttosto sicura. In caso un pacchetto fosse danneggiato, l'aggiornamento potrebbe essere annullato anche per gli altri pacchetti. In questo casto, è necessario escludere dall'aggiornamento il pacchetto che da problemi, con il seguente comando:

yum --exclude=pacchetto_da_escludere* update

Se si conosce il nome esatto, si può omettere l'asterisco *, in alternativa, digitare parte del nome ed utilizzare l'asterisco per far completare a yum the name of the package to exclude.

ExtraPutty logo, SSH, Linux, CentOS, commandsAdd 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).

Exim, mta, mail transfer agent, centos commands useful exim

Message queue list

exim -bp

Message queue count

Follow me on Instagram channel. Retro technology, Commodore, vintage audio, retro computers, experiments and tests. Retroprogramming, Basic. Commodore, IBM, Atari, Apple, Texas Instruments, Amstrad, MSX.

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
PHP updated, PHP -V, VestaCP PHP update to version 7.3.

Subscribe my YouTube channel ValorosoIT. Retro technology, vintage audio, retro computers, experiments and tests. Retroprogramming, Basic. Commodore, IBM, Atari, Apple, Texas Instruments, Amstrad, MSX.

Posted in Computers and Technology, All articles.

Leave a Reply

Your email address will not be published. Required fields are marked *