Sida looga soo saaro xuduudaha ka imanaya Terminal-ka Qoraalka Shell

El Shell Scripting, Waxaa loola jeedaa fulinta amarrada adag ku saabsan GNU / Linux Terminal (Console), waa mid aad waxtar u leh in otomatigga laga dhigo howlaha caadiga ah ee ka jira gudaha Nidaamka Howlgalka GNU / Linux, taas oo noo ogolaaneysa inaan hagaajino kuweenna Kheyraadka iyo Waqtiga, taasi waa, waxa halkan ku jira waxaan ku baari doonnaa sida laga soo bilaabo terminaalka aan u fulin karno amarrada gacanta ee markaa noo oggolaanaya jadwalka / otomaatiga nashaadyada ku saabsan koox badbaadinta Saacadaha / Shaqada oo ah buug gacmeed ama dil fool-ka-fool ah, fulinta amarrada lagu sheegay Bash Shell ama Qoraal iswaafajinaya oo lagu sharaxay qaab wax ku ool ah oo fudud.

Xulashada_007Waxaan ku daboolidoonaa sida gudaha hal amar oo amar ah podemos soosaar oo soo bandhig qiimaha / macluumaadka Nidaamka Howlgalka / Qalabka, taas oo aan markaa ku hirgelin karno a Qoraalka Bash Shell si otomaatig ah hawl gaar ah. Diirad saarida Dhaqannada ugu Fiican loo baahan yahay si loo helo naqshad aad u fiican oo Qorniinka jidka ku jirta waxtar badan oo wax ku ool ah.

————————————————————-
Hel magaca isticmaaleha ugu horreeya ee nidaamka lagu abuuray:
————————————————————-

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

—————————————————————————
Hel dariiqa / guriga isticmaalaha ugu horreeya ee lagu abuuray nidaamka:
—————————————————————————

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

-------------
Hubi Taariikhda Qalabka Hadda:
-------------

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

------------
Hubi Waqtiga Qalabka Hadda:
------------

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

————————————————–
Hubi haddii martigaliyaha uu leeyahay xiriir internet ah:
————————————————–

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
-------------
Hubi nooca Nidaamka Howlgalka:
-------------

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

----------------------
Hubi magaca, nooca iyo duminta Nidaamka Howlgalka:
----------------------
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

----------------
Hubi qaab dhismeedka Nidaamka Howlgalka:
----------------

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

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

------------------
Hubi noocyada firida ee Nidaamka Howlgalka:
------------------

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

----------
Hubi magaca martida:
----------

NOMBRE_HOST=$(cat /etc/hostname) ; echo $NOMBRE_HOST
----------------------
Hubi Gudaha iyo Dibedda IP (Soo-saarista Internetka ee Weyn):
----------------------

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

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

------------------
Hubi Qiimayaasha (IP / MAC) ee Isku-xirka Shabakadda:
------------------

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
————————————————
Hubi Wakiilka / Albaabka Nidaamka Howlgalka:
————————————————

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

————————————————–
Hubi Magaca Shabakadda Marti Geliyaha:
————————————————–

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

---------------------
Hubi Cinwaanka Shabakadda (IP) ee martigeliyaha Server Server:
---------------------

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

-------------
Hubi isticmaaleyaasha ku xiran martida:
-------------

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
————————————————————————————————————
Ku hubi Faylka Isticmaalaha xog intaa ka badan (# Faylasha / Cabbirka Baytes) ee Nidaamka Howlgalka:
----------------------------------

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

————————————————————————————————
Hubi Cabirka Baaylka Faylka Superuser ama Faylka kale ee Nidaamka Howlgalka:
————————————————————————————————

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

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

--------------------
Hubi fayllada isticmaale ee la abuuray (Magacyada iyo Nambarada):
--------------------

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

---------------------
Hubi Isticmaalayaasha leh UID 0 IYO GID 0 (SUPERUSERS) la abuuray:
---------------------

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

--------------
Hubi xaaladda RAM iyo Swap xasuusta:
--------------

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

------------------------
Hubi Xaaladda jajabyada / buurta dhibic ee SATA Disk:
------------------------

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

---------------------
Hubi Culayska Nidaamka Celceliska (Nidaamka Safka):
---------------------

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

————————————————
Hubi hababka Zombies ee Nidaamka Howlgalka:
————————————————

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

---------------------
Hubi Wadarta Waqtiga Shaqada (Bilow / On):
---------------------

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

---------------
Hubi xuduudaha kaarka Video:
---------------

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

Kan sameeyey:

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

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

Xusuusta RAM:

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

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

Module (Darawal):

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

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

3D dardargelinta:

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

--------------
Hubi xuduudaha processor-ka (processor):
--------------

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

Kan sameeyey:

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

=======

Tusaale:

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

=========

Tirada:

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

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

Xargaha halkii processor:

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

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

Wadarta Guud ahaan halkii CPU:

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

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

Xusuusta CPU

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

Waxaan rajeynayaa kuwaan yar "Talooyin" u fududee iyaga si ay u qabtaan waxayaabaha aasaasiga ah laakiin waxtar u leh, kuwaas oo guud ahaan loogu talagalay khabiirada Teknolojiyada, Xisaabinta, Barnaamijka Bilaashka ah iyo GNU / Linux.

MUUQAALO MUUQAAL AH

jalbert: bash - Konsole_008

jalbert: bash - Konsole_009

Xusuusnow: Haddii xariiq kasta oo amar ah uu ku guuldareysto inuu fuliyo ama muujiyo qiimaha saxda ah, hubi inaad gacanta ku tijaabiso qayb kasta oo ka mid ah amarka degdegga ah si aad isugu daydo oo aad u hagaajiso qiimaha ama qaabeynta qaar ka mid ah doorsoomayaasha.


Nuxurka maqaalka wuxuu u hogaansamayaa mabaadi'deena anshaxa tifaftirka. Si aad u soo sheegto khalad guji Halkan.

7 faallooyin, ka tag taada

Ka tag faalladaada

cinwaanka email aan la daabacin doonaa.

*

*

  1. Masuul ka ah xogta: Miguel Ángel Gatón
  2. Ujeedada xogta: Xakamaynta SPAM, maaraynta faallooyinka.
  3. Sharci: Oggolaanshahaaga
  4. Isgaarsiinta xogta: Xogta looma gudbin doono dhinacyada saddexaad marka laga reebo waajibaadka sharciga ah.
  5. Kaydinta xogta: Macluumaadka ay martigelisay Shabakadaha Occentus (EU)
  6. Xuquuqda: Waqti kasta oo aad xadidi karto, soo ceshan karto oo tirtiri karto macluumaadkaaga.

  1.   Eduardo dijo

    Waad ku mahadsantihiin.

    Aad u faa'iido badan.

  2.   HO2Gi dijo

    Aad baad u mahadsantahay.

  3.   Jose Albert dijo

    Raaxo lagu wada shaqeeyo! Dhawaan waxaan ku sii dhejin doonaa waxyaabo badan oo ku saabsan adeegsiga Qoraalka Shell ee kiisaska wax ku oolka ah.

  4.   0. 0 dijo

    Injineer aad u wanaagsan! Waxaan rajeyneynaa inay jiraan maqaallo badan oo Qoraalka Shell ah.

  5.   Francis Tovar dijo

    Amarada lagu muujiyey halkaa waa kuwo aad u fiican oo aad waxtar u leh.

  6.   isticmaalaha dijo

    Waad ku mahadsantahay macluumaadka qiimaha badan; laakiin xaaladdayda amarrada qaarkood ma bixiyaan natiijada la filayo, tusaale ahaan amarka "yaa" iyo "w" waxba ma muujiyaan; Tani way igu dhacday aniga tan iyo markii aan sameeyay cusbooneysiinta nidaamka (waxaan u isticmaalaa archlinux oo leh maamulaha shaashadda "lxdm" iyo jawi garaaf ah "xfce 4.12"). Fikrad kasta oo dhacda (natiijadu waa isku mid xitaa haddii aan isticmaalo xididka isticmaalaha).
    Waad ku mahadsan tahay.

  7.   Jose Albert dijo

    Waxay jeclaan lahaayeen Nidaam khabiir ah oo lagu sameeyay Shell Scripting oo marka la codsado abuuri doona soo saarida dhammaan cabbirada nidaamka qaab Warbixin.

    Tusaale waxa lagu sameyn karo Qoraalka Shell:

    LPI-SB8 Screen Test ScreenCast (LINUX POST INSTALL - QORAALKA BICENTENARIO 8.0.0)
    (lpi_sb8_adaptation-audiovisual_2016.sh / 43Kb)

    Eeg Shaashadda: https://www.youtube.com/watch?v=cWpVQcbgCyY

bool (run)