Useradd –m user1 =ser yaratish Userdel –r usernomi =serni o’chirish Ls –l /home Cat /etc/passwd =ser bor yaratilganligni tekshirish Cat /etc/shadow =serga parol bor yo’qligini tekshirish Passwd user1 =serga parol qo’yish Cd /etc/skel/ =ser yaratilganda userni ichiga avtomat ravishda papkalar yaratish uchun oldindan apka yaratish yuli Mkdir desktop =apka yaratish Mkdir video =papka yaratish Touch file.txt =fayl yaratish Ls –l Useradd –m user2 =user yaratish Ls –l /home/ Groupadd guruhnomi =guruh yaratish Cat /etc/group =guruhni tekshirish Groupdel guruhnomi =guruhni o’chirish Id usernomi userni =id si va guruhini tekshirish Usermod –aG guruhnomi usernomi =userni guruhga qo’shish Id usernomi =Id si va guruhini tekshirish Deluser usernomi guruhnomi =userni guruhdan chiqarish Id usernomi =d si va guruhini tekshirish nano /etc/hostname =Kampyuter nomni o`zgartrish nano /etc/ssh/sshd_config =ssh ni portni o`zgartrish /etc/init.d/ssh restart = Service ssh restart Link yaratish va Arxivlash linux os da ln –s /papka ili filenomi /qayergaligi/\ Misol: 1. touch index.php 2.ln –sndex.php /var/www/html 3. ls –al /var/www/html Arxivlash tar cvf nomi(arxivnomi).tar (arxivga olish kk bulgan papka ili file nomi)
tar cf nomi(arxivnomi).tar (arxivgaolishkk bulgan papka ili file nomi) ARXIVDAN chiqarish tar xvf nomi(arxivnomi).tar arxivdan chiqarish Arxivlash gzipnomi(arxivnomi).tar arxivga olish .gz
gunzipnomi(arxivnomi).tar.gz arxivdan chiqarish
du –shazmerni bilish papka ili fayl chmod 777 -R sambapapka =barcha papkalarga ruxsat berish
Papka fayllarga huquq berish
r- read-4 o’qishga huquq
w- write-2 yozishga huquq
x- execute-1 bajarishga huquq (4+2+1=7) J Misol: chmod 777 (fayli yoki papkanomi) chmod 777 * (turgan joydagi barcha fayllar yoki papkaga ga barcha huquqni beradi) owner – group – others
chmod 666 papka1/ faqat papka uv=chun ruxsat
chmod 666 -R papka1/ -R papka ichdagi hamma narsaga tasir etadi
rwx- rwx- rwx >>777ga teng yani hama huquq bor(ochilgan)
rwx- r-x r-x >>755ga teng Linux operatsion tizimida Scriptlar yaratish
3. ./script.sh yoki sh script.sh (scriptni ishga tushirish)
#! /bin/bash Mkdir /media/newfolder Ls /media
#! /bin/bash Rm -r /media/newfolder Ls /media
nano ip.sh (IP addressni aniqlash uchun script) #! /bin/bash echo “Sizning IP address:” ifconfig chmod +x ip.sh (scriptga huquq berish) ./ip.sh (scriptni ishga tushirish)
Arxivlash tar cvf nomi(arxivnomi).tar (arxivga olish kk bulgan papka ili file nomi)
tar cf nomi(arxivnomi).tar (arxivgaolishkk bulgan papka ili file nomi) ARXIVDAN chiqarish tar xvf nomi(arxivnomi).tar arxivdan chiqarish Arxivlash gzip nomi(arxivnomi).tar arxivga olish .gz
gunzip nomi(arxivnomi).tar.gz arxivdan chiqarish
du –sh razmerni bilish papka ili fayl
bzip2 nomi(arxivnomi).tar .tar.bz2
bunzip2 nomi(arxivnomi).tar.bz2 arxivdan chiqarish
xz nomi(arxivnomi).tar .tar.xz
unxz nomi(arxivnomi).tar.xz arxivdan chiqarish
Group yaratish Tar cf mytar.tar papka Tar xf mytar .tar Gzip /bzip2 /xz Gunzip /bunzip2 /unxz Tar cvzf aa.bz2
Tar tf aa.bz2 kurish Zip –r myzip.zip papka Unzip myzip.zip chiqarish
APT-paketlarni boshqarish vostasi (Debian, Ubuntu, boshqalar)
apt remove ms =urnatgan programlarni o`chrish apt instal ms =paketni o`rnatish yangilash apt-get update =yangilangan paketlar royxatni olish apt-get clean =yuklab olingan paket fayillar ro`yxatni o`chrish apt-get check =qaramanglikning yaxlitlikni ro`yxatni o`chrish apt-cache search =mos keladgan paketlar ro`yxatni chiqaradi
Linux OS ga dasturlar va serverlar urnatish apt-get updatesoft listni ovnovit qilish apt-get upgradeurnatilgan paketlarni obnovlaniya qilish apt-get help apt-get bilan qilanadigan ishlar komandalar haqida cat /etc/*release*sistemani versiyaini bilish cat /etc/issue sistemani versiyaini bilish cat /proc/versionsistemani versiyaini bilish ls -dl /var/log/installersistemani qachon urnatilgan sanasini bilish Webmin dasturini urtanish nano etc/apt/sources.list dpkg -lunatilgan softlarni ruyhati apt-get install dastur nomiustonovka qilish apt remove dastur nomiuchirish apt purge dastur nomiuchirish(nastroykasi bn) sudo apt-get install samba samba serverni o`rnatish sudo service smbd restart samba servir restart sudo service smbd start samba servir start sudo service smbd stop samba servir stop sudo service samba restart apt-cache search dastur nomi apt-cache show dastur nomi soft haqida malumot apt-cache showpkg dastur nomi soft haqida kuproq malumot Midnight Commander ni urnatish apt-get install mc Ishga tushirish Midnight Commander sudo mc soft listga qushib quyish kerak webmin ni address ni deb http://download.webmin.com/download/repository sarge contrib wget http://www.webmin.com/jcameron-key.asc
sudo apt-get install webmin webminga kirish browser orqali https://localhost:10000 timedatectl setime (20:50) (2022-02-25) t-ubuntu serverda sana va vaqtni to`g`rlash