Me pehea te tango i nga taapiri mai i te Terminal e whakamahi ana i te Huringa Huri

El Tuhinga o te Shell, E pa ana ki te whakatinana i nga ota matatini e pā ana ki te GNU / Linux Terminal (Papatohu), he mea tino pai ki te mahi aunoa i nga mahi nui me nga mahi nui i roto i a tatou Pūnaha Mahi GNU / Linux, e taea ai e taatau te whakapai i ta maatau Nga Rauemi me te Waa, ara, me nga mea o roto ka tirohia taatau me pehea mai i te taunga ka taea te whakamahi i nga whakahau a-ringa kia pai ai te tuku rārangi / mahi aunoa nga mahi e pa ana ki te penapena a te roopu Haora / Mahi o te whakamahi-a-kanohi-ki-te kanohi ranei, te whakamahi i aua ota i roto i te Bash Shell Script he hototahi ranei, me te whakamarama ma te huarahi mahi me te ngawari.

Tīpakonga_007Ka hipokina e matou i roto i he whakahau whakahau kotahi ka taea e tatou tango me te whakaatu i nga uara / korero mai i te punaha whakahaere / taputapu, ka taea e taatau te whakamahi i roto i a Hōtuhi Bash Shell ki te mahi aunoa i tetahi mahi motuhake. Te arotahi ki te Nga Mahi Pai e tika ana kia whiwhi hoahoa pai rawa mai i tetahi tuhinga pai ake me te whaihua.

——————————————————
Tikina te ingoa o te kaiwhakamahi tuatahi i hangaia i te punaha:
——————————————————

USER_1000=$(cat /etc/passwd | grep 1000 | cut -d: -f1) ;  echo $USER_1000

USER_1001=$(cat /etc/passwd | grep 1001 | cut -d: -f1) ;  echo $USER_1001

————————————————————
Tirohia te ara o te / kaainga o te kaiwhakamahi tuatahi i hangaia i runga i te punaha:
————————————————————

USER_1000=$(cat /etc/passwd | grep 1000 | cut -d: -f1) ; HOME_USER_1000=/home/$USER_1000 ; echo $HOME_USER_1000

USER_1001=$(cat /etc/passwd | grep 1001 | cut -d: -f1) ; HOME_USER_1001=/home/$USER_1001 ; echo $HOME_USER_1001

-------------
Tirohia Te Ra Taputapu o Naianei:
-------------

FECHA_ACTUAL=$(date +"%d %b %y") ; echo $FECHA_ACTUAL

------------
Tirohia Te Wa Taputapu o Naianei:
------------

HORA_ACTUAL=$(date +"%H:%M") ; echo $HORA_ACTUAL

——————————————
Tirohia mēnā he hononga Ipurangi to te Kaihautu:
——————————————

if ping -c 1 8.8.8.8 &> /dev/null; then CONEXION_INTERNET=Habilitado; else CONEXION_INTERNET=Deshabilitado; fi ; echo $CONEXION_INTERNET

TEST_PING=$(ping 192.168.3.249 -c 5 | grep packet | awk '{print $6}' | cut -f1 -d%) ; echo $TEST_PING % de Perdida de paquetes
TEST_LATENCIA=$(ping 8.8.8.8 -c 5 | grep packet | awk '{print $10}' | cut -f1 -d%) ; echo $TEST_LATENCIA de Latencia del Enlace
-------------
Tirohia te momo Punaha Whakahaere:
-------------

SISTEMA_OPERATIVO=$(uname -o) ; echo $SISTEMA_OPERATIVO

----------------------
Tirohia te ingoa, te putanga me te takahuri o te punaha Whakahaere:
----------------------
NOMBRE_SISTEMA=$(cat /etc/os-release | grep NAME | grep -v "VERSION" | sed -n '2p' | cut -f2 -d\") ; echo $NOMBRE_SISTEMA
VERSION_SISTEMA=$(cat /etc/os-release | grep VERSION= | sed -n '1p' | sed 's/VERSION=//' | sed 's/"//g') ; echo $VERSION_SISTEMA

SUBVERSION_SISTEMA=$(lsb_release -d | awk '{print $4}') ; echo $SUBVERSION_SISTEMA

----------------
Tirohia te hoahoanga o te punaha Whakahaere:
----------------

ARQUITECTURA=$(uname -m) ; echo $ARQUITECTURA

ARQUITECTURA=$(uname -m) ; if [[ "$ARQUITECTURA" = "x86" ]]; then ARQ_SISTEMA=32; else ARQ_SISTEMA=64; fi ; echo $ARQ_SISTEMA

------------------
Tirohia te waahanga o te punaha Whakahaere:
------------------

VERSION_KERNEL=$(uname -r) ; echo $VERSION_KERNEL

----------
Tirohia te Ingoa Kaihautū:
----------

NOMBRE_HOST=$(cat /etc/hostname) ; echo $NOMBRE_HOST
----------------------
Tirohia te IP a-roto, a-Waho (Putanga Ipurangi Matua):
----------------------

IP_INTERNA=$(hostname -I) ; echo $IP_INTERNA

IP_EXTERNA=$(curl -s ipecho.net/plain;echo) ; echo $IP_EXTERNA

------------------
Tirohia nga Uara (IP / MAC) o nga Atanga Whatunga:
------------------

IP_ETH0=$(ifconfig eth0 | grep inet | grep -v inet6 | cut -d ":" -f 2 | cut -d " " -f 1) ; echo $IP_ETH0

MAC_ETH0=$(ifconfig eth0 | sed -n '1p' | awk '{print $5}') ; echo $MAC_ETH0

IP_WLAN0=$(ifconfig wlan0 | grep inet | grep -v inet6 | cut -d ":" -f 2 | cut -d " " -f 1) ; echo $IP_WLAN0

MAC_WLAN0=$(ifconfig wlan0 | sed -n '1p' | awk '{print $5}') ; echo $MAC_WLAN0
———————————————
Tirohia te Takawaenga / Kaha o te punaha Whakahaere:
———————————————

PROXY_GATEWAY=$(route -n | sed -n '3p' | awk '{print $2}') ; echo $PROXY_GATEWAY

——————————————
Tirohia te Ingoa Rohe Kaihautuku Whatunga:
——————————————

DOMINIO=$(cat /etc/resolv.conf | sed '2 d' | grep search | sed -n '1p' | awk '{print $2}') ; echo $DOMINIO

-----------------------
Tirohia te Wāhitau Whatunga (IP) o te Kaiwhakahaere DNS Kaihaututu:
-----------------------

IP_SERVIDOR_DNS=$(cat /etc/resolv.conf | sed '1 d' | awk '{print $2}') ; echo $IP_SERVIDOR_DNS

---------------
Tirohia nga kaiwhakamahi e hono ana ki te Kaihautu:
---------------

who>/tmp/who ; echo -e "Usuarios conectados al Host :"  && echo "" && echo "Usuarios Puertos      Fecha      Hora  Pantalla" ; echo "*************************************************************************" && cat /tmp/who

USUARIOS_CONECTADOS=$(who | awk '{print $1}') ; echo $USUARIOS_CONECTADOS

USER_ONLINE1=$(who | awk '{print $1}') ; echo $USER_ONLINE1 | wc -w

USER_ONLINE2=$(top -n 1 -b | grep "load average:" | awk '{print $6}') ; echo $USER_ONLINE2
——————————————————————————————————
Tirohia te Kōpaki Kaiwhakamahi me te maha atu o nga raraunga (# o nga konae / Rahi i nga Paita) kei roto i te punaha Whakahaere.
----------------------------------

CARPETA_USUARIO1=$(ls -l /home | sed '1 d' | sort -k2 | sed q | awk '{print $9}') ; echo $CARPETA_USUARIO1

DATA_USUARIO1=$(du -sh /home/* | sort -r | sed q | awk '{print $1}') ; echo $DATA_USUARIO1

————————————————————————————
Tirohia te Rahi i nga Paita o te Kōpaki Superuser me etahi atu Kōpaki o te punaha Whakahaere:
————————————————————————————

DATA_ROOT=$(du -sh /root | awk '{print $1}') ; echo $DATA_ROOT

DATA_CARPETA1=$(du -sh /var | awk '{print $1}') ; echo $DATA_CARPETA1

--------------------
Tirohia nga Kōpaki Kaiwhakamahi Hangaia (Nga Ingoa me nga Nama):
--------------------

NOMBRES_CARPETAS=$(ls -l /home | sed '1 d' | awk '{print $9}') ; echo $NOMBRES_CARPETAS

NUMERO_CARPETAS=$(ls -l /home | sed '1 d' | awk '{print $9}') ; echo $NUMERO_CARPETAS | wc -w

-----------------------
Tirohia nga Kaiwhakamahi me UID 0 AND GID 0 (SUPERUSERS) i hangaia:
-----------------------

SUPERUSUARIOS_UID=$(awk -F: '{if ($3==0) print $1}' /etc/passwd) ; echo $SUPERUSUARIOS_UID

SUPERUSUARIOS_GID=$(awk -F: '{if ($3==0) print $1}' /etc/passwd) ; echo $SUPERUSUARIOS_GID

--------------
Tirohia te mana o te RAM me te maumahara Huri:
--------------

MEM_TOTAL=$(free -h | sed '1 d' | grep Mem: | awk '{print $2}') ; echo $MEM_TOTAL

MEM_USADA=$(free -h | sed '1 d' | grep Mem: | awk '{print $3}') ; echo $MEM_USADA

MEM_LIBRE=$(free -h | sed '1 d' | grep Mem: | awk '{print $4}') ; echo $MEM_LIBRE

MEM_COMPARTIDA=$(free -h | sed '1 d' | grep Mem: | awk '{print $5}') ; echo $MEM_COMPARTIDA

MEM_ALMACENADA=$(free -h | sed '1 d' | grep Mem: | awk '{print $6}') ; echo $MEM_ALMACENADA

MEM_CACHEADA=$(free -h | sed '1 d' | grep Mem: | awk '{print $7}') ; echo $MEM_CACHEADA

SWAP_TOTAL=$(free -h | sed '1 d' | grep Swap: | awk '{print $2}') ; echo $SWAP_TOTAL

SWAP_USADA=$(free -h | sed '1 d' | grep Swap: | awk '{print $3}') ; echo $SWAP_USADA


SWAP_LIBRE=$(free -h | sed '1 d' | grep Swap: | awk '{print $4}') ; echo $SWAP_LIBRE

------------------------
Tirohia te Whakatakotoranga o nga wehenga / tohu o te kopae SATA:
------------------------

PART1_TOTAL=$(df -h | sed '1 d' | grep /dev/sda5 | awk '{print $2}') ; echo $PART1_TOTAL

PART1_USADO=$(df -h | sed '1 d' | grep /dev/sda5 | awk '{print $3}') ; echo $PART1_USADO

PART1_DISPONIBLE=$(df -h | sed '1 d' | grep /dev/sda5 | awk '{print $4}') ; echo $PART1_DISPONIBLE

PART1_PORCENTAJE=$(df -h | sed '1 d' | grep /dev/sda5 | awk '{print $5}') ; echo $PART1_PORCENTAJE

PART1_PUNTOMONTAJE=$(df -h | sed '1 d' | grep /dev/sda5 | awk '{print $6}') ; echo $PART1_PUNTOMONTAJE

-----------------------
Tirohia nga Waha Punaha Toharite (Tukanga Tapa):
-----------------------

CARGA_1MIN=$(top -n 1 -b | grep "load average:" | awk '{print $10}' | sed 's/,//2') ; echo $CARGA_1MIN

CARGA_5MIN=$(top -n 1 -b | grep "load average:" | awk '{print $11}' | sed 's/,//2') ; echo $CARGA_5MIN

CARGA_15MIN=$(top -n 1 -b | grep "load average:" | awk '{print $12}' | sed 's/,//2') ; echo $CARGA_15MIN

CARGA_1MIN=$(uptime | awk '{print $8}' | sed 's/,//2') ; echo $CARGA_1MIN

CARGA_5MIN=$(uptime | awk '{print $9}' | sed 's/,//2') ; echo $CARGA_5MIN

CARGA_15MIN=$(uptime | awk '{print $10}' | sed 's/,//2') ; echo $CARGA_15MIN

———————————————
Tirohia nga mahinga Zombies i te punaha Whakahaere:
———————————————

PROC_ZOMBIE=$(top -n 1 -b | grep "zombie" | awk '{print $10}') ; echo $PROC_ZOMBIE

-----------------------
Tirohia Te Wahanga Mahi Katoa (Tiimata / Mutunga):
-----------------------

TIEMPO_ENCENDIDO=$(uptime | awk '{print $3,$4}' | cut -f1 -d,) ; echo $TIEMPO_ENCENDIDO

---------------
Tirohia nga taatari kaata Ataata:
---------------

============

Kaihanga:

FAB_TVIDEO=$(lspci -v | grep "VGA" | cut -d " " -f05) ; echo $FAB_TVIDEO

============

Pūmahara RAM:

MEM_TVIDEO=$(lspci -v -s `lspci | awk '/VGA/{print $1}'` | sed -n '/Memory.*, prefetchable/s/.*\[size=\([^]]\+\)M\]/\1/p') ; echo $MEM_TVIDEO

================

Kōwae (Atekōkiri):

DRV_TVIDEO=$(lspci -nnk | grep -i vga -A3 | grep 'in use' | cut -d " " -f05) ; echo $DRV_TVIDEO

===============

Whakaterenga 3D:

A3D_TVIDEO=$(glxinfo | grep "direct rendering: Yes" | awk '{print $3}') ; echo $A3D_TVIDEO

--------------
Tirohia te Huarahi Tukatuka (PTM):
--------------

===========

Kaihanga:

FABRICANTE_CPU=$(grep "vendor_id" /proc/cpuinfo | sed q | awk '{print $3}') ; echo $FABRICANTE_CPU

=======

Aratau:

MODELO_CPU=$(grep "model name" /proc/cpuinfo | sed q | cut -d ":" -f 2 | awk '{print $0}') ; echo $MODELO_CPU

=========

Rahi:

NUM_CPU=$(grep "processor" /proc/cpuinfo | sort -r | sed q | awk '{print $3}') ; TOTAL_CPU=$((`expr $NUM_CPU + 1`)) ; echo $TOTAL_CPU

================

Cores mo ia PTM:

NUCLEO_CPU=$(grep "cpu cores" /proc/cpuinfo | sed q | awk '{print $4}') ; echo $NUCLEO_CPU

==========================

Nga Taonga Katoa mo ia PTM:

NUM_CPU=$(grep "processor" /proc/cpuinfo | sort -r | sed q | awk '{print $3}') ; TOTAL_CPU=$((`expr $NUM_CPU + 1`)) ; NUCLEO_CPU=$(grep "cpu cores" /proc/cpuinfo | sed q | awk '{print $4}') ; TOTAL_NUCLEO_CPU=$((`expr $TOTAL_CPU \* $NUCLEO_CPU`)) ; echo $TOTAL_NUCLEO_CPU

======================

Mahara keteroki CPU:

CACHE_CPU=$(grep "cache size" /proc/cpuinfo | sed q | cut -d ":" -f 2 | awk '{print $0}') ; echo $CACHE_CPU

Ko te tumanako ko enei tamariki nohinohi "Tohu Awhina" whakangawari atu ki a raatau ki te mahi i nga waahanga pai engari tino pai rawa atu, ko te nuinga ka rahuitia ma nga tohunga anake Hangarau, rorohiko, Rorohiko Koreutu me te GNU / Linux.

PANUITANGA MAHI

jalbert: bash - Konsole_008

jalbert: bash - Konsole_009

Whakamaumahara: Mena kaore e taea e tetahi raina whakahau te whakamahi te whakaatu ranei i te uara tika, kia mahara ki te whakamatautau a ringa i ia waahanga o te whakahau whakahau kia ngana ki te whakatika i nga uara, ki te wetewete ranei o etahi taurangi.


Ko nga korero o te tuhinga e piri ana ki o maatau kaupapa o matatika whakatika. Ki te ripoata i tetahi paatene paato Here.

7 korero, waiho maau

Waiho to korero

Ka kore e whakaputaina tō wāhitau īmēra.

*

*

  1. He kawenga mo nga raraunga: Miguel Ángel Gatón
  2. Te kaupapa o te raraunga: Whakahaerehia te SPAM, te whakahaere korero.
  3. Ture: To whakaae
  4. Whakawhitinga korero: Kaore nga korero e tukuna ki nga taha tuatoru engari ma te ture herenga.
  5. Rokiroki raraunga: Paetukutuku e whakahaerehia ana e Occentus Networks (EU)
  6. Tika: I nga wa katoa ka taea e koe te whakaiti, te whakaora me te muku i o korero.

  1.   Eduardo ka mea

    Mauruuru nui koe.

    Tino whaihua.

  2.   HO2Gi ka mea

    Tino pai nga mihi.

  3.   Ingarangi Jose Albert ka mea

    He pai ki te mahi tahi! Akuanei ka whakaputahia e au etahi atu mo te whakamahi i te Papaituhi Papa i nga keehi tino whaihua.

  4.   cr0t0 ka mea

    He kaipūkaha pai! Ko te tumanako ka nui ake nga tuhinga Scripting Shell.

  5.   Francis Tovar ka mea

    Ko nga whakahau e whakaatuhia ana he pai, he tino whaihua.

  6.   Kaiwhakamahi ka mea

    Mauruuru mo nga korero tino nui; engari ki au ko etahi ota kaore e whakaatu i nga hua e tika ana, hei tauira ko te whakahau "ko wai" me te "w" kaore e whakaatu i tetahi mea. Kua pa tenei ki ahau mai i taku whakahoutanga o te punaha (Ka whakamahia e au te archlinux me te kaiwhakahaere mata "lxdm" me te taiao whakairoiro "xfce 4.12"). Tetahi whakaaro he aha te mea ka tupu (he rite te mutunga ahakoa ka whakamahi ahau i te pakiaka o te kaiwhakamahi).
    Mauruuru.

  7.   Ingarangi Jose Albert ka mea

    Kei te hiahia ratou ki tetahi punaha tohunga i hangaia me te Panui Panui ma te tono ka puta mai nga tangohanga katoa o te punaha i roto i te ahua o te Riipoata.

    He tauira mo nga mea ka taea te mahi ma te Hika Panui:

    LPI-SB8 Whakamatau WhakamaataMata (LINUX POST INSTALL - SCRIPT BICENTENARIO 8.0.0)
    (lpi_sb8_adaptation-audiovisual_2016.sh / 43Kb)

    Tirohia te Matapihi: https://www.youtube.com/watch?v=cWpVQcbgCyY