├── README.md ├── tar-2 ├── bashexpansions.png ├── terminalcolors.png ├── package managers.png ├── Absolute+&+relative+Path.png ├── arithmeticoperationsbash.png ├── Linux_Essentials_cheatsheet.png ├── linux-somecommand ├── cat-command ├── tar-command ├── network1 ├── handson-users-files.md ├── less-command ├── date-exam ├── linux codes.txt ├── linuz date ├── bash prompt characters.txt └── turkish-linux-command /README.md: -------------------------------------------------------------------------------- 1 | # linux notes 2 | #linux commands 3 | 4 | 5 | ...mm// 6 | 7 | # cssmm.. 8 | -------------------------------------------------------------------------------- /tar-2: -------------------------------------------------------------------------------- 1 | tar -czf archive.tar.gz file1 file2 2 | tar -xf archive.tar.gz 3 | # very important ./ 4 | -------------------------------------------------------------------------------- /bashexpansions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethanflower1903/linux-command/HEAD/bashexpansions.png -------------------------------------------------------------------------------- /terminalcolors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethanflower1903/linux-command/HEAD/terminalcolors.png -------------------------------------------------------------------------------- /package managers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethanflower1903/linux-command/HEAD/package managers.png -------------------------------------------------------------------------------- /Absolute+&+relative+Path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethanflower1903/linux-command/HEAD/Absolute+&+relative+Path.png -------------------------------------------------------------------------------- /arithmeticoperationsbash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethanflower1903/linux-command/HEAD/arithmeticoperationsbash.png -------------------------------------------------------------------------------- /Linux_Essentials_cheatsheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethanflower1903/linux-command/HEAD/Linux_Essentials_cheatsheet.png -------------------------------------------------------------------------------- /linux-somecommand: -------------------------------------------------------------------------------- 1 | gzip filename 2 | gzip -c filename > filename.gz 3 | gzip -k filename 4 | gzip -1 filename 5 | gzip filename1 filename2 6 | -------------------------------------------------------------------------------- /cat-command: -------------------------------------------------------------------------------- 1 | and using the output redirection operator > you can concatenate the content of multiple files into a new file: 2 | cat file1 file2 > file3 3 | Using >> you can append the content of multiple files into a new file, creating it if it does not exist: 4 | cat file1 file2 >> file3 5 | #very important ....//, 6 | # very comfortable...///// 7 | #<<< 8 | -------------------------------------------------------------------------------- /tar-command: -------------------------------------------------------------------------------- 1 | # tar command shorts commands very important.... 2 | tar -cf archive.tar file1 file2 3 | The tar command is used to create an archive, grouping multiple files in a single file. 4 | 5 | Its name comes from the past and means tape archive (back when archives were stored on tapes). 6 | 7 | This command creates an archive named archive.tar with the content of file1 and file2: 8 | # new section... 9 | # commands tar.. 10 | -------------------------------------------------------------------------------- /network1: -------------------------------------------------------------------------------- 1 | DEVICE – Ağ kartının adını, 2 | 3 | ONBOOT – Ağın açılışta aktif edilme durumunu, 4 | 5 | BOOTPROTO – Network ayarlarının nasıl yapılacağını (static, dhcp, bootp), 6 | 7 | IPADDR – IP adresini, 8 | 9 | NETMASK – Ağ maskesini, 10 | 11 | BROADCAST – Broadcast adresini, 12 | 13 | GATEWAY – Gateway adresini belirtir. 14 | 15 | Ayrıca MAC adresi, Ağ tipi gibi çeşitli ayarlarda bulunmaktadır. 16 | 17 | DHCP kullanarak IP alınmak istendiğinde DEVICE, BOOTPROTO ve ONBOOT ayarlarının yazılması yeterli olacaktır. 18 | # very important..//// 19 | 20 | -------------------------------------------------------------------------------- /handson-users-files.md: -------------------------------------------------------------------------------- 1 | # Create userA and userB and check if the users created 2 | - useradd [OPTIONS] USERNAME 3 | - useradd creates a new user account according to the options specified on the command line and the default values set in the /etc/default/useradd 4 | - The command adds an entry to the /etc/passwd, /etc/shadow, /etc/group and /etc/gshadow files 5 | - only sudo users can create 6 | ```bash 7 | sudo useradd userA 8 | sudo useradd userB 9 | sudo cat /etc/passwd 10 | ``` 11 | 12 | # Give userA admin rights 13 | - With the new user created, it's time to give them sudo rights. For this we'll use the usermod command like so: 14 | ```bash 15 | sudo usermod -aG sudo userA 16 | ``` 17 | 18 | # Create /operations folder 19 | ```bash 20 | cd / 21 | mkdir operations 22 | ``` 23 | # User A must have admin rights on /operations 24 | -------------------------------------------------------------------------------- /less-command: -------------------------------------------------------------------------------- 1 | Once you are inside a less session, you can quit by pressing q.../////// 2 | 3 | You can navigate the file contents using the up and down keys, or using the space bar and b to navigate page by page. You can also jump to the end of the file pressing G and jump back to the start by pressing g. 4 | 5 | You can search contents inside the file by pressing / and typing a word to search. This searches forward. You can search backwards using the ? symbol and typing a word. 6 | 7 | This command just visualizes the file's content. You can directly open an editor by pressing v. It will use the system editor, which in most cases is vim. 8 | 9 | Pressing the F key enters follow mode or watch mode. When the file is changed by someone else, like from another program, you get to see the changes live. 10 | 11 | This doesn't happen by default, and you only see the file version at the time you opened it. You need to press ctrl-C to quit this mode. In this case the behaviour is similar to running the tail -f command. 12 | 13 | You can open multiple files, and navigate through them using:n (to go to the next file) and :p (to go to the previous)... 14 | 15 | you are interested./../ 16 | 17 | -------------------------------------------------------------------------------- /date-exam: -------------------------------------------------------------------------------- 1 | Örnekler; very good...selam nasilsin.//..// 2 | # very good exams....//////.... 3 | [root@omeroner ~]# date 4 | Thu May 2 17:38:06 EEST 2013 5 | [root@omeroner ~]# date +%j 6 | 122 7 | [root@omeroner ~]# date +%D 8 | 05/02/13 9 | [root@omeroner ~]# date "+%A %B %Y" 10 | Thursday May 2013 11 | [root@omeroner ~]# date +%A%D%Y 12 | Thursday05/02/132013 13 | [root@omeroner ~]# date "+%j %U %Y" 14 | 122 17 2013 15 | [root@omeroner ~]# date "+%d %m %y" 16 | 02 05 13 17 | [root@omeroner ~]# date "+%a %b" 18 | Thu May 19 | [root@omeroner ~]# date "+%I:%M %p" 20 | 05:40 PM 21 | [root@omeroner ~]# date "+%A %B %d %Y" 22 | Thursday May 02 2013 23 | [root@omeroner ~]# date 24 | Thu May 2 17:38:06 EEST 2013 25 | [root@omeroner ~]# date +%j 26 | 122 27 | [root@omeroner ~]# date +%D 28 | 05/02/13 29 | [root@omeroner ~]# date "+%A %B %Y" 30 | Thursday May 2013 31 | [root@omeroner ~]# date +%A%D%Y 32 | Thursday05/02/132013 33 | [root@omeroner ~]# date "+%j %U %Y" 34 | 122 17 2013 35 | [root@omeroner ~]# date "+%d %m %y" 36 | 02 05 13 37 | [root@omeroner ~]# date "+%a %b" 38 | Thu May 39 | [root@omeroner ~]# date "+%I:%M %p" 40 | 05:40 PM 41 | [root@omeroner ~]# date "+%A %B %d %Y" 42 | Thursday May 02 2013 43 | # very ...//// 44 | -------------------------------------------------------------------------------- /linux codes.txt: -------------------------------------------------------------------------------- 1 | pwd: print working directory.../// 2 | hostname: my computer's network name 3 | mkdir: make directory 4 | cd: change directory (~:home, /:root, ..:up, ../../directory: 2up and go another directory) 5 | ls: list directory (l:details, p:shows files with/, a:hidden included) 6 | rmdir: remove directory 7 | pushd: push directory 8 | popd: pop directory 9 | cp: copy a file or directory [source][destination] 10 | mv: move, rename a file or directory 11 | less: page through a file 12 | cat: print the whole file (short for "concatenate")(cat FILE > FILE to copy) 13 | xargs: execute arguments 14 | find: find files 15 | grep: searches for lines which contain a search pattern 16 | man: read a manual page 17 | apropos: find what man page is appropriate 18 | env: look at your environment 19 | echo: print some arguments 20 | export: export/set a new environment variable 21 | exit: exit the shell 22 | sudo: super user do! 23 | chmod: change permission modifiers 24 | chown: change ownership 25 | diff: shows the differences between 26 | groups: shows which groups a user is a member of. 27 | ping: checks connectivity status to a server 28 | wget: download files from the internet 29 | date: show date and time 30 | cal: show calendar 31 | !17 run 17th command on history 32 | #comfortable 33 | -------------------------------------------------------------------------------- /linuz date: -------------------------------------------------------------------------------- 1 | Linux’ta mevcut saat ve tarihi görmek için;./ 2 | 3 | [root@omeroner ~]# date 4 | 1 5 | [root@omeroner ~]# date 6 | komutu yazılır. Çıktısı aşağıdakine benzerdir. 7 | 8 | Thu May 2 17:12:45 EEST 2012 9 | 1 10 | Thu May 2 17:12:45 EEST 2012 11 | Burada tarihin 2 Mayıs 2012 saat 17:12 olduğunu EEsT ise saat diliminin Eastern European Summer Time(Doğu Avrupa Yaz Saati) zone’unda bulunduğu anlamına gelmektedir. 12 | 13 | 14 | Tarihi saatle birlikte değiştirmek için ise; 15 | 16 | #date MMDDhhmmYYYY 17 | 1 18 | #date MMDDhhmmYYYY 19 | Örneğin tarihi 15 Ocak 2014 saat 12:15’e almak için; 20 | 21 | [root@omeroner ~]# date 011512152014 22 | Wed Jan 15 12:15:00 EET 2014 23 | 1 24 | 2 25 | [root@omeroner ~]# date 011512152014 26 | Wed Jan 15 12:15:00 EET 2014 27 | Tarihi değiştirmenin başka bir yolu’da; 28 | 29 | [root@omeroner ~]# date -s "Thu May 2 17:21:33 EEST 2013" 30 | Thu May 2 17:21:33 EEST 2013 31 | 1 32 | 2 33 | [root@omeroner ~]# date -s "Thu May 2 17:21:33 EEST 2013" 34 | Thu May 2 17:21:33 EEST 2013 35 | Örnekte, 2 Mayıs 2013 saat 17:21 saniye 33. a aldık. 36 | 37 | Yalnızca saati değiştirmek için ise; 38 | 39 | [root@omeroner ~]# date +%T -s "11:11:11" 40 | 11:11:11 41 | 1 42 | 2 43 | [root@omeroner ~]# date +%T -s "11:11:11" 44 | 11:11:11 45 | date komutu “date +%X” seklinde kullanılır. Format “+%X” şeklindedir. X’in yerine gelebilecek seçenekler aşağıda sıralanmıştır... 46 | -------------------------------------------------------------------------------- /bash prompt characters.txt: -------------------------------------------------------------------------------- 1 | # very important../// 2 | \a : an ASCII bell character (07) 3 | \d : the date in “Weekday Month Date” format (e.g., “Tue May 26”) 4 | \D{format} : the format is passed to strftime(3) and the result is inserted into the prompt string; 5 | an empty format results in a locale-specific time representation. The braces are required 6 | \e : an ASCII escape character (033) 7 | \h : the hostname up to the first ‘.’ 8 | \H : the hostname 9 | \j : the number of jobs currently managed by the shell 10 | \l : the basename of the shell’s terminal device name 11 | \n : newline 12 | \r : carriage return 13 | \s : the name of the shell, the basename of $0 (the portion following the final slash) 14 | \t : the current time in 24-hour HH:MM:SS format 15 | \T : the current time in 12-hour HH:MM:SS format 16 | \@ : the current time in 12-hour am/pm format 17 | \A : the current time in 24-hour HH:MM format 18 | \u : the username of the current user 19 | \v : the version of bash (e.g., 2.00) 20 | \V : the release of bash, version + patch level (e.g., 2.00.0) 21 | \w : the current working directory, with $HOME abbreviated with a tilde 22 | \W : the basename of the current working directory, with $HOME abbreviated with a tilde 23 | \! : the history number of this command 24 | \# : the command number of this command 25 | \$ : if the effective UID is 0, a #, otherwise a $ 26 | \nnn : the character corresponding to the octal number nnn 27 | \\ : a backslash 28 | \[ : begin a sequence of non-printing characters, which could be used to embed a terminal 29 | control sequence into the prompt 30 | \] : end a sequence of non-printing characters 31 | # important 32 | # ggood 33 | -------------------------------------------------------------------------------- /turkish-linux-command: -------------------------------------------------------------------------------- 1 | Linux commands... 2 | 3 | find 4 | Geniş bir kullanımı olan arama komutudur. 5 | find -name 6 | Aramayı büyük küçük harfe duyarsız olarak yapmak için iname parametresi kullanılır. 7 | find -iname 8 | Aranacak dosya veya dizinin tam adı bilinmiyorsa yıldız (*) karakteri kullanılabilir. 9 | find -name 10 | Örneğin; Uzantısı .txt olan dosyaları bulmak için aşağıdaki komut kullanılabilir. 11 | find -name <*.txt> 12 | Aramada bulunan dosya ve dizinleri seçmek için type parametresi kullanılır. 13 | Parametre d alırsa dizin, f alırsa dosyaları listeler. 14 | find -type d 15 | Aranan ifadenin boyutunu belirtmek için size parametresi kullanılır. 16 | find -name -size +10k 17 | Dosyanın tarihiyle ilgili arama yapmak için amin, mmin, cmin vb. parametreler kullanılabilir. 18 | find -name -mmin +10 19 | Zaman ifadelerinin önündeki işaret artı (+) ise belirtilen zamandan fazla, eksi (–) ise belirtilen zamandan az herhangi bir ifade yoksa tam zaman verilmiş olur. 20 | Boş dosya veya dizinleri bulmak için empty parametresi kullanılır. 21 | find -name -empty 22 | Boş dosya veya dizinleri bulmak için empty parametresi kullanılır. 23 | Dizin haklarını bulmak için perm parametresi kullanılır. 24 | find -name -perm 777 25 | Bulunan ifadeler için komut çalıştırmak için exec parametresi kullanılır. 26 | find -name -exec 27 | Örneğin; Bulunan ifadeleri silmek için aşağıdaki komut kullanılabilir. 28 | find -name -exec rm -rf {} \; 29 | Aranacak dizin adımını belirtmek için maxdepth parametresi kullanılır. 30 | find -name -maxdepth X 31 | Örneğin; Aranan .conf uzantılı dosyanın sadece aranan dizinde bulunması için aşağıdaki komut kullanılabilir. 32 | find /etc *.conf -maxdepth 1 33 | Komut ihtiyaçlara göre farklı parametrelerle birlikte kullanılarak sonuç alınabilir. 34 | whereis ve which 35 | Çalıştırılabilir dosyaların konumunu bulmak için kullanılır. 36 | whereis 37 | whereis cd 38 | which 39 | which cd 40 | grep 41 | Arama yapmak için kullanılır. 42 | grep 43 | Aramayı büyük küçük harfe duyarsız olarak yapmak için i parametresi kullanılır. 44 | grep -i 45 | Aramayı dizin altındaki tüm dosya ve dizinlerde yapmak için r parametresi kullanılır. 46 | grep -r 47 | Arama sırasında başlangıç (^) ve bitiş ($) karakterleri ile arama yapılabilir. 48 | grep -ir '^Merhaba' dosya.txt 49 | Arama ile dosya.txt içerisinde Merhaba ile başlayan yer bulunacaktır. 50 | Komut çoğunlukla ardışık komutlarda komut çıktısında arama yapmak için kullanılır. 51 | ls -lah | grep '^d' 52 | Benzer şekilde diğer komutlarla birlikte de kullanılabilir. 53 | --------------------------------------------------------------------------------