Open Source advantage: Mesela ubuntu’nun ara yüzlerini kendine göre tasarlayıp kendi distro’nuzu oluşturabilirsiniz.
Git : version controlling system for linux
Linux provides thousands upon thousands of software titles of high quality.
Open source allows you the software to be freely use, inspect, modify, share, copy and enhance it.
There are two cathegories which is permissive licenses and copyleft licenses in open source licenses. Copyleft licenses are inclusive of permissive licenses.
Most popular Linux distributions: LinuxMint, Ubuntu, Debian(first release distro), elementary OS, Fedora, RHEL(Red Hat Enterprises Linux), Manjaro, Centos.
FSF (Free Software Foundation) is a mission to promote computer user freedom.
Linux commands;
pwd : shows directory you are in, print working directory
ls : shows files of directory you are in, list
ls -l : shows directory with details
ls -a: shows files of directory you are in(also hidden files)
cd folder name: goes to folder (attention! → case sensitive, \ may be use for space errors in folder names), change directory
cd.. : to go back folder before(git bash te çalışmadı)
mkdir directory name: make directory command, make directory
mkdir -p : alt alta sıralı klasörler oluşturur.
rmdir directory name: remove directory cmd.(for only empty directories), remove directory
rm directory name: remove all kind of directories(full or empty)
rm -r directory name: remove directory only.
rm -rf directory name : remove directory with ingredients
rm file name: remove files
rm -R : remove folder and inside files
touch file name.txt(etc.) : create file cmd.
man command name: manual pages of the command to help how to use it(git bash te çalışmadı), manual
command — help: explain how to use this command
cp file name.txt(etc.) source dir. dest.dir.: copy file(s)
mv file name.txt file new name.txt: rename files and folders command
mv directory name/file name directory name/file new name(optional) and cut->copy
clear : clear the terminal
ctrl+L : clear the screen previous commands are above of screen
find file name : search for files and directories
ATTENTİON!!!in my git bash i have to use as a folder name Desktop not desktop and with this ~/ signs.
$ isareti bilgisiyarda tam yetkiniz olmadigini gosterir (normal user).
# isareti tam yetkili oldugumuzu gosterir (privilaged user).
command -v : gives information about process (copy, makedirectory etc.)
sleep 1000 : 1000 saniye uyutur uyandırmak için ctrl+c
Dosya oluştururken uzantı yazmazsak yine de dosya oluşturulur.
echo : “linux” aynısını döndürür
echo “expression” > file name içine yazar öncekini siler
cat file name echo ile yazılanı gösterir
echo “expression” >> file name öncekini silmeden yazar
echo “” > file name içeriği siler
linux te case sensitivity var
touch file name{1..20}.txt 20 tane dosya oluşturur.
rm f???6.* tam bilmediğimiz bu şartlara uyan dosyaları siler
cd ../.. : iki klasör önceye gider
echo “expression” > olmayan_dosya hem dosya oluşturur, hem içine yazar
tree : folder-file tree (in Git Bash tree.com(tre yazdıktan sonra tab ile tamamla))
explorer . : bulunduğun klasörü açar(wsl2 de explorer.exe .)
hostname : @LAPTOP-FE68JP bilgisayarın ismi
whoami : user name
hostname : computer name
hostname -i : IP number and computer name (gitbash te çalışmadı)
her klasörde gizli iki dosya var . ve .. ile gösterilir.
ls ./foldername -lap : üstteki klasördeyken klasöre gitmeden listeler(git bash de çalışmadı)
ll : gizli dosyalarıda gösterir ls -al nin kısası
rm -i file name : ask again about removing
cat > file name satırları enterla inerek yazarız boş satıra inince ctrl+c ile dosyadan çıkarız.
cat >> üsttekinin aynısı ve öncekini silmeden yazar
Absolute Path : always start with “/” (root directory)
Absolute path sample : mv /c/Users/Sadullah\ TANRIKULU/Desktop/countries/germany/file.txt / c/Users/Sadullah\ TANRIKULU/Desktop/countries/france/file4.txt
Relative path : starts at your current directory
head -number of lines : üstten gösterdiği satır sayısı default 10 dur. uzun dosya içeriklerinde avantajlı.
tail -number of lines : allttan gösterdiği satır sayısı default 10 dur.
less file name : satır satır hepsini gösterir, bitirmek için ctrl+z
.filename : gizli dosya demektir mv ile durumu değişir.
info command : herşeyiyle yardım 100 sayfa falan.
info ls > info_ls.txt olarak txt dosyasına yazdırır.
history : kullandığım komutlar
history -c : history yi siler.
ls -al > ls.txt : bulunduğum klasörün içeriğini ls.txt dosyasına yazar diğerlerinde de çalışıyor
there are stopped jobs hatası olunca ctrl+c ve sonra tekrar exit ile CLI kapatılabilir.
-rwx r — r — : ilk — dosya olduğunu gösterir, d ise directory old. göst., r :read, w: write, x : execute, r — : permissions for group members, r — : permissions for other users
permissions kısmında değişiklik için : user için “u”, group için “g” ve other users için “o” kullanılır. chmod g-wx filename yazarsak grubun write ve execute yetkilerini almış oluruz veya chmod o+wx filename yazarsak diğer kullanıcılara write ve execute yetkisi vermiş oluruz.
hem user hem group hem de other users için a+rwx yazarsak hepsini tam yetkilendirir veya tam tersini yapabiliriz.
Permission numbers are:
- 0 = — -
- 1 = — x
- 2 = -w-
- 3 = -wx
- 4 = r-
- 5 = r-x
- 6 = rw-
- 7 = rwx
For example : chmod 777 foldername will give read, write, and execute permissions for everyone.
ping google.com : check the connectivity status between source and destination devices.
ping -c 5 google.com : check by sending 5 packages connectivity status between source and destination devices.
pem uzantısı cloud makineye bağlanma anahtarı dosyalarında olur.
ssh -i marcus.pem ubuntu(username)@IP adress başka bir server a bağlanmak için (pem dosyası kendi bilgisayarımızda olmalı)
chmod -R 774 folder name klasörü ve altındaki dosya klasör ne varsa izinleri değiştirir.
File system Hierarchy Standart (FHS)
ssh : secure shell connect to remote hosts command.
touch file name.sh ile executable bir dosya oluşturup sonra;
nano file name.sh ile içine girip sıralı komutlar yazabiliriz, sonra komut satırında;
.file name.sh ile çağırıp çalıştırabiliriz.
text editörleri serverlara bağlanmak, configürasyon dosyalarını silmek, değiştirmek vs için kullanıyoruz.
vi, vim ve nano olarak 3 tane editör var.
vim dosya adı dosyaya giriş için.
i insert modu, esc insertten çıkar komut moduna geçer, kaydedip çıkış için :wq!
x ve X siler, u son hareketleri geri alır
yy kopyalar, p yapıştırır, bd satırı siler
dd satırı siler, d ye basılı tutunca herşeyi siliyor
esc ZZ hızlı çıkış, bul değiştir için :%s/aranankelime/yenikelime/g
NANO da ctrl ile alttaki harfler yardım için kullanılıyor.
.bashrc dosyası ubuntu ayarlarını içerir, alias update = “sudo apt update -y” update kelimesine devamındaki komutu kısayol atadık fakat .bashrc dosyasına yazılmazsa bu atama kaybolur.
special question : chmod ile tüm dosyaların permission durumunu değiştirdiğimiz dosya gibi olmasını(inheritance) sağlayın?