GNU/Linux Terminal Essential Commands

GNU/Linux komutları ve kısaca Türkçe anlamları: Ayrıca buradaki kitabı da inceleyebilirsiniz.

Linux komutu (Linux command) Anlamı (Mean) Örnek kullanımı
touch Dosya oluşturur touch myFile
df Diskin boş olma durumunu gösterir
kill Çalışmakta olan işlemleri sonlandırma için kullanılır
chmod Okuma yazma ve çalıştırma izinleri yönetimi için kullanılır
which Sorgulanan linux komnutunun yerini,kökünü gösterir
pwd Bulunulan dizini gösterir
cd Dizine gitme işlemlerini gerçekleştirir
ls Dizindeki dosyaları listeler
ls -l
ls -la
ls -ls

-rw-------   1 bshotts  bshotts       576 Apr 17  1998 weather.txt
drwxr-xr-x   6 bshotts  bshotts      1024 Oct  9  1999 web_page
-rw-rw-r--   1 bshotts  bshotts    276480 Feb 11 20:41 web_site.tar
-rw-------   1 bshotts  bshotts      5743 Dec 16  1998 xmas_file.txt

----------     -------  -------  -------- ------------ -------------
    |             |        |         |         |             |
    |             |        |         |         |         File Name
    |             |        |         |         |
    |             |        |         |         +---  Modification Time
    |             |        |         |
    |             |        |         +-------------   Size (in bytes)
    |             |        |
    |             |        +-----------------------        Group
    |             |
    |             +--------------------------------        Owner
    |
    +----------------------------------------------   File Permissions
less Bir dosyayı okumanıza yardımcı olur, anlık büyüyen bir dosya ise duraklayıp yukarıda kalan satırlara geri dönüp incelemenize olanak sağlar. less my-log-file.log
less +F less +F my-log-file.log
less + Page Up veya less + b Bir sayfa geri kaydırma
less + Page Down veya less + boşluk karakteri Bir sayfa ileri kaydırma
less + G Metin dosyasının sonuna git
less + 1G Metin dosyasının başlangıcına git
less less + /’karakter’
less + n Önceki aramayı tekrarla
less less + h
less + q Çıkış
cp Dosyalar veya dizinleri kopyalar
cp dosya01 dosya02 dosya01 içeriği dosya02 içeriğine kopyalar, dosya02 mevcut değil ise oluşturulur.
cp -i dosya01 dosya02 “cp dosya01 dosya02” komutu ile aynı işi yapar ancak dosya02 mevcut ise öncesinde onay istenip sonrasında işleme devam edilir.
cp dosya01 dizin01 dosya01 in içeriği dizin01 in içerisine aynı dosya adı ile kopyalanır
cp *.txt dizin01 txt uzantılı bütün dosyalar dizin01 dizini içerisine kopyalanır
cp -R dir01 dir02 dizin01 i dizin02 nin içene kopyalar, dizin02 mevcut değil ise dizin02 oluşturulur.
scp güvenli kopyalama
mv Dosyalar veya dizinleri taşır veya yeniden adlandırır
mv dosya01 dosya02 dosya02 mevcut değil ise dosya01, dosya02 olarak isimlendirilir.Eğer dosya02 mevcut ise dosya01 in içeriği dosya02 nin içeriği ile değiştirilir.
mv -i dosya01 dosya02 “mv dosya01 dosya02” komutu ile aynı işi yapar ancak dosya02 mevcut ise öncesinde onay istenip sonrasında işleme devam edilir.
mv dosya01 dosya02 dosya03 dizin01 dosya01, dosya02 ve dosya03 dosyaları dizin01 dizinine taşınır. dizin01 mevcut değil ise işlem gerçekleşmeyecek ve hata alınacaktır.
mv dizin01 dizin02 Eğer dizin02 yok ise dizin02, dizin02 olarak isimlendirilir. Eğer dizin02 var ise dizin01, dizin02 dizinine taşınır.
mv dizin01 ../*.log dizin02 dizin01 dizini ve bir alt sizindeki .log uzantılı bütün dosyalar bulunulan dizindeki mevcut olan dizin02 dizinine taşınır
rm Dosyalar veya dizinleri siler
rm dosya01 dosya02 dosya01 ve dosya02 i sil
rm -i dosya01 dosya02 “rm dosya01 dosya02” komutu ile aynı işi yapar ancak öncesinde her dosya için onay istenir
rm -r dizin01 dizin02 dizin01 ve dizin02 dizinleri içerikleri ile birlikte silinir
rm -rf * bulunulan dizindeki bütün dizinleri içerikleri ile birlikte zorlayarak siler
mkdir Dizin oluşturur
mkdir dizin01 dizin01 adında dizin oluşturur
type komutun tipi hakkında bilgi görüntüler
type type type is a shell builtin
type mv mv is /bin/mv
which komutun yerini saptar
which ls /bin/ls
which cp /bin/cp
help referans sayfasını gösterme
help -m cd oguzhankinik@oguzkinik:~$ help -m cd NAME cd – Change the shell working directory. SYNOPSIS cd [-L|[-P [-e]]] [dir] DESCRIPTION Change the shell working directory. Change the current directory to DIR. The default DIR is the value of the HOME shell variable. The variable CDPATH defines the search path for the directory containing DIR. Alternative directory names in CDPATH are separated by a colon (:). A null directory name is the same as the current directory. If DIR begins with a slash (/), then CDPATH is not used. If the directory is not found, and the shell option `cdable_vars’ is set, the word is assumed to be a variable name. If that variable has a value, its value is used for DIR. Options: -L force symbolic links to be followed -P use the physical directory structure without following symbolic links -e if the -P option is supplied, and the current working directory cannot be determined successfully, exit with a non-zero status The default is to follow symbolic links, as if `-L’ were specified. Exit Status: Returns 0 if the directory is changed, and if $PWD is set successfully when -P is used; non-zero otherwise. SEE ALSO bash(1) IMPLEMENTATION GNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later
mkdir –help oguzhankinik@oguzkinik:~$ mkdir –help Usage: mkdir [OPTION]… DIRECTORY… Create the DIRECTORY(ies), if they do not already exist. Mandatory arguments to long options are mandatory for short options too. -m, –mode=MODE set file mode (as in chmod), not a=rwx – umask -p, –parents no error if existing, make parent directories as needed -v, –verbose print a message for each created directory -Z, –context=CTX set the SELinux security context of each created directory to CTX –help display this help and exit –version output version information and exit Report mkdir bugs to bug-coreutils@gnu.org GNU coreutils home page: General help using GNU software: For complete documentation, run: info coreutils ‘mkdir invocation’
man komutun referansına ulaşmamızı sağlar. manuel, el kitabı
man ls LS(1) User Commands LS(1) NAME ls – list directory contents SYNOPSIS ls [OPTION]… [FILE]… DESCRIPTION List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuvSUX nor –sort is speci‐ fied. Mandatory arguments to long options are mandatory for short options too. -a, –all do not ignore entries starting with . -A, –almost-all do not list implied . and .. –author with -l, print the author of each file -b, –escape print C-style escapes for nongraphic characters –block-size=SIZE scale sizes by SIZE before printing them. E.g., `–block-size=M’ prints sizes in units of 1,048,576 bytes. See SIZE format below. -B, –ignore-backups do not list implied entries ending with ~ -c with -lt: sort by, and show, ctime (time of last modification of file status information) with -l: show ctime and sort by name otherwise: sort by ctime, newest first -c with -lt: sort by, and show, ctime (time of last modification of file status information) with -l: show ctime and sort by name otherwise: sort by ctime, newest first -C list entries by columns –color[=WHEN] colorize the output. WHEN defaults to `always’ or can be `never’ or `auto’. More info below -d, –directory list directory entries instead of contents, and do not derefer‐ ence symbolic links -D, –dired generate output designed for Emacs’ dired mode -f do not sort, enable -aU, disable -ls –color -F, –classify append indicator (one of */=>@|) to entries –file-type likewise, except do not append `*’ –format=WORD across -x, commas -m, horizontal -x, long -l, single-column -1, verbose -l, vertical -C –full-time like -l –time-style=full-iso -g like -l, but do not list owner –group-directories-first group directories before files. augment with a –sort option, but any use of –sort=none (-U) disables grouping -G, –no-group in a long listing, don’t print group names -h, –human-readable with -l, print sizes in human readable format (e.g., 1K 234M 2G) –si likewise, but use powers of 1000 not 1024 -H, –dereference-command-line follow symbolic links listed on the command line –dereference-command-line-symlink-to-dir follow each command line symbolic link that points to a direc‐ tory –hide=PATTERN do not list implied entries matching shell PATTERN (overridden by -a or -A) –indicator-style=WORD append indicator with style WORD to entry names: none (default), slash (-p), file-type (–file-type), classify (-F) -i, –inode print the index number of each file -I, –ignore=PATTERN do not list implied entries matching shell PATTERN -k like –block-size=1K -l use a long listing format -L, –dereference when showing file information for a symbolic link, show informa‐ tion for the file the link references rather than for the link itself -m fill width with a comma separated list of entries -n, –numeric-uid-gid like -l, but list numeric user and group IDs -N, –literal print raw entry names (don’t treat e.g. control characters spe‐ cially) -o like -l, but do not list group information -p, –indicator-style=slash append / indicator to directories -q, –hide-control-chars print ? instead of non graphic characters –show-control-chars show non graphic characters as-is (default unless program is `ls’ and output is a terminal) -Q, –quote-name enclose entry names in double quotes –quoting-style=WORD use quoting style WORD for entry names: literal, locale, shell, shell-always, c, escape -r, –reverse reverse order while sorting -R, –recursive list subdirectories recursively -s, –size print the allocated size of each file, in blocks -S sort by file size –sort=WORD sort by WORD instead of name: none -U, extension -X, size -S, time -t, version -v –time=WORD with -l, show time as WORD instead of modification time: atime -u, access -u, use -u, ctime -c, or status -c; use specified time as sort key if –sort=time –time-style=STYLE with -l, show times using style STYLE: full-iso, long-iso, iso, locale, +FORMAT. FORMAT is interpreted like `date’; if FORMAT is FORMAT1FORMAT2, FORMAT1 applies to non-recent files and FORMAT2 to recent files; if STYLE is prefixed with `posix-‘, STYLE takes effect only outside the POSIX locale -t sort by modification time, newest first -T, –tabsize=COLS assume tab stops at each COLS instead of 8 -u with -lt: sort by, and show, access time with -l: show access time and sort by name otherwise: sort by access time -U do not sort; list entries in directory order -v natural sort of (version) numbers within text -w, –width=COLS assume screen width instead of current value -x list entries by lines instead of by columns -X sort alphabetically by entry extension -Z, –context print any SELinux security context of each file -1 list one file per line –help display this help and exit –version output version information and exit SIZE may be (or may be an integer optionally followed by) one of fol‐ lowing: KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y. Using color to distinguish file types is disabled both by default and with –color=never. With –color=auto, ls emits color codes only when standard output is connected to a terminal. The LS_COLORS environment variable can change the settings. Use the dircolors command to set it. Exit status: 0 if OK, 1 if minor problems (e.g., cannot access subdirectory), 2 if serious trouble (e.g., cannot access command-line argument). AUTHOR Written by Richard M. Stallman and David MacKenzie. REPORTING BUGS Report ls bugs to bug-coreutils@gnu.org GNU coreutils home page: General help using GNU software: Report ls translation bugs to COPYRIGHT Copyright © 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO The full documentation for ls is maintained as a Texinfo manual. If the info and ls programs are properly installed at your site, the com‐ mand info coreutils ‘ls invocation’ should give you access to the complete manual. GNU coreutils 8.12.197-032bb September 2011 LS(1)
I/O I/O
Girdi işlemleri Girdi işlemleri
ls > lsCiktiDosyam ls in çıktı sonucunu lsCiktiDosyam01 dosyasının içeriği ile değiştirir.
ls >> lsCiktiDosyam02 ls in çıktı sonucunu lsCiktiDosyam02 dosyasının içine ekler.
locate Dizin yolu tespit edilmek istenilen dosyanın konumunu verir. -name ile case sensitive yani büyük küçük harf duyarlı -iname ile ise case insensitive yani büyük küçük harf duyarsız şekilde ara yapar locate -name “myFileName”, locate -iname “myFileName”
source Açık olan terminal ekranındayken güncellenen bir dosyanın içeriğinin bu açık terminalde görünebilmesini sağlar source /etc/environment

Girdi/Çıktı Yönlendirmesi (I/O Redirection)

  • Standart Input
ls > file_list.txt ls >> file_list.txt
  • Standart Output
ls < file_list.txt sort < file_list.txt > sorted_file_list.txt
  • Pipeline
ls -l | less
Command What it does
ls -lt | head Displays the 10 newest files in the current directory.
du | sort -nr Displays a list of directories and how much space they consume, sorted from the largest to the smallest.
find . -type f -print | wc -l Displays the total number of files in the current working directory and all of its subdirectories.
  • Filtrelemeler
Komut Açıklama Örnek Kullanım
sort Sorts standard input then outputs the sorted result on standard output.
uniq Given a sorted stream of data from standard input, it removes duplicate lines of data (i.e., it makes sure that every line is unique).
grep Examines each line of data it receives from standard input and outputs every line that contains a specified pattern of characters.
fmt Reads text from standard input, then outputs formatted text on standard output.
pr Takes text input from standard input and splits the data into pages with page breaks, headers and footers in preparation for printing.
head Outputs the first few lines of its input. Useful for getting the header of a file.
tail tail -f * ilgili dizindeki bütün dosyaların son satırlarını ve sonrasında gelecek olan satırları görmemizi sağlar. Günlük dosyası gibi son satırı çok artabilecek dosyaları izlemek için kullanışlıdır. tail myFileName, tail -20 myFileName, tail -f myFileName
tr Translates characters. Can be used to perform tasks such as upper/lowercase conversions or changing line termination characters from one type to another (for example, converting DOS text files into Unix style text files).
sed Stream editor. Can perform more sophisticated text translations than tr. Dosyadaki bir kelimeyi yeni bir kelime ile değiştirme. sed -i ‘s/old_one_word/new_one_word/g’ *.properties
awk An entire programming language designed for constructing filters. Extremely powerful. who am i | awk ‘{print$3}’

Expansion

  • echo
echo this is a test this is a test echo * Desktop Documents ls-output.txt Music Pictures Public Templates Videos

Pathname Expansion

ls
Desktop
ls-output.txt
Documents Music
Pictures
Public
Templates
Videos

echo D*
Desktop Documents

 echo *s
Documents Pictures Templates Videos

echo [[:upper:]]*
Desktop Documents Music Pictures Public Templates Videos

echo /usr/*/share
/usr/kerberos/share /usr/local/share

Tilde Expansion

echo ~ /home/me echo ~foo /home/foo

Arithmetic Expansion

echo $((2 + 2)) 4 echo $(($((5**2)) * 3)) 75 echo $(((5**2) * 3)) 75 echo Five divided by two equals $((5/2)) Five divided by two equals 2 echo with $((5%2)) left over. with 1 left over.

Brace Expansion

echo Front-{A,B,C}-Back Front-A-Back Front-B-Back Front-C-Back echo Number_{1..5} Number_1 Number_2 Number_3 Number_4 Number_5
echo {Z..A} Z Y X W V U T S R Q P O N M L K J I H G F E D C B A
echo a{A{1,2},B{3,4}}b
aA1b aA2b aB3b aB4b
mkdir Photos cd Photos

mkdir {2007..2009}-0{1..9} {2007..2009}-{10..12}

ls
2007-01 2007-07 2008-01 2008-07 2009-01 2009-07
2007-02 2007-08 2008-02 2008-08 2009-02 2009-08
2007-03 2007-09 2008-03 2008-09 2009-03 2009-09
2007-04 2007-10 2008-04 2008-10 2009-04 2009-10
2007-05 2007-11 2008-05 2008-11 2009-05 2009-11
2007-06 2007-12 2008-06 2008-12 2009-06 2009-12

Parameter Expansion

echo $USER me printenv | less echo $SUER

Command Substitution

echo $(ls) Desktop Documents ls-output.txt Music Pictures Public Templates Videos ls -l $(which cp) -rwxr-xr-x 1 root root 71516 2007-12-05 08:58 /bin/cp file $(ls /usr/bin/* | grep bin/zip)
/usr/bin/bunzip2:
/usr/bin/zip:      ELF 32-bit LSB executable, Intel 80386, version 1
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
/usr/bin/zipcloak: ELF 32-bit LSB executable, Intel 80386, version 1
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
/usr/bin/zipgrep:  POSIX shell script text executable
/usr/bin/zipinfo:  ELF 32-bit LSB executable, Intel 80386, version 1
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
/usr/bin/zipnote:  ELF 32-bit LSB executable, Intel 80386, version 1
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
/usr/bin/zipsplit: ELF 32-bit LSB executable, Intel 80386, version 1
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

ls -l `which cp`
-rwxr-xr-x 1 root root 71516 2007-12-05 08:58 /bin/cp

Quoting

echo this is a     test
this is a test [me@linuxbox me]$[me@linuxbox ~]$ echo The total is $100.00 The total is 00.00

Double Quotes

ls -l two words.txt
ls: cannot access two: No such file or directory
ls: cannot access words.txt: No such file or directory

ls -l "two words.txt"
-rw-rw-r-- 1 me me 18 2008-02-20 13:03 two words.txt
mv "two words.txt" two_words.txt

echo "$USER $((2+2)) $(cal)"
me 4
February 2008
Su Mo Tu We Th Fr Sa
                1  2
 3  4  5  6  7  8  9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29


 echo this is a     test
this is a test

echo "this is a     test"
this is a     test

echo $(cal) February 2008 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 [me@linuxbox me]$ echo "$(cal)"
February 2008
Su Mo Tu We Th Fr Sa
                1  2
 3  4  5  6  7  8  9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29

Single Quotes

echo text ~/*.txt {a,b} $(echo foo) $((2+2)) $USER text /home/me/ls-output.txt a b foo 4 me echo "text ~/*.txt {a,b} $(echo foo) $((2+2)) $USER" text ~/*.txt {a,b} foo 4 me echo 'text ~/*.txt {a,b} $(echo foo) $((2+2)) $USER' text ~/*.txt {a,b} $(echo foo) $((2+2)) $USER





Escaping Characters

echo "The balance for user $USER is: \$5.00" The balance for user me is: $5.00 mv bad\&filename good_filename
Escape Character Name Possible Uses
\n newline Adding blank lines to text
\t tab Inserting horizontal tabs to text
\a alert Makes your terminal beep
\\ backslash Inserts a backslash
\f formfeed Sending this to your printer ejects the page



echo -e "Inserting several blank lines\n\n\n"
Inserting several blank lines

echo -e "Words\tseparated\tby\thorizontal\ttabs."


Words separated   by  horizontal  tabs


echo -e "\aMy computer went \"beep\"."

My computer went "beep".



echo -e "DEL C:\\WIN2K\\LEGACY_OS.EXE"

DEL C:\WIN2K\LEGACY_OS.EXE

Permissions

  • chmod – modify file access rights
  • su – temporarily become the superuser
  • sudo – temporarily become the superuser
  • chown – change file ownership
  • chgrp – change a file’s group ownership







Dosya izin yetkisi ile ilgili dosya veya dizinlere kimin okuma, yazma ve çalıştırma hakkı olduğunu gösterir.

[code language=”shell”] oguzhankinik@oguzkinikcomp:$ ls -l /bin/bash -rwxr-xr-x 1 root root 316848 Feb 27 2000 /bin/bash oguzhankinik@oguzkinikcomp:$ ls -l /home/Projects/HyComDev01 total 8 drwxr-xr-x 4 root root 4096 Oca 27 2017 sts-bundle drwxr-xr-x 13 root root 4096 Oca 27 2017 workspace [/code]

chmod

[code language=”shell”] sudo chmod 777 /home/Projects/HyComDev01/workspace [/code] çalıştırılınca workspace klasörü yetkisi aşağıdaki gibi yükseltilir [code language=”shell”] oguzhankinik@oguzkinikcomp:/home/Projects/HyComDev01/workspace/hybris/bin/platform$ ls -l /home/Projects/HyComDev01 total 8 drwxr-xr-x 4 root root 4096 Oca 27 2017 sts-bundle drwxrwxrwx 13 root root 4096 Oca 27 2017 workspace oguzhankinik@oguzkinikcomp:/home/Projects/HyComDev01/ [/code]
Value Meaning
777 (rwxrwxrwx) No restrictions on permissions. Anybody may do anything. Generally not a desirable setting.
755 (rwxr-xr-x) The file’s owner may read, write, and execute the file. All others may read and execute the file. This setting is common for programs that are used by all users.
700 (rwx——) The file’s owner may read, write, and execute the file. Nobody else has any rights. This setting is useful for programs that only the owner may use and must be kept private from others.
666 (rw-rw-rw-) All users may read and write the file.
644 (rw-r–r–) The owner may read and write a file, while all others may only read the file. A common setting for data files that everybody may read, but only the owner may change.
600 (rw——-) The owner may read and write a file. All others have no rights. A common setting for data files that the owner wants to keep private.





Dizin izinleri

  • r – Alt dizinlere de izin verir. kullanımı: chmod -R 777 /home/Projects/HyComDev01/workspace
  • w – Allows files within the directory to be created, deleted, or renamed if the x attribute is also set.
  • x – Allows a directory to be entered (i.e. cd dir).
 
Value Meaning
777 (rwxrwxrwx) No restrictions on permissions. Anybody may list files, create new files in the directory and delete files in the directory. Generally not a good setting.
755 (rwxr-xr-x) The directory owner has full access. All others may list the directory, but cannot create files nor delete them. This setting is common for directories that you wish to share with other users.
700 (rwx——) The directory owner has full access. Nobody else has any rights. This setting is useful for directories that only the owner may use and must be kept private from others.





Becoming The Superuser For A Short While

[me@linuxbox me]$ su
Password:
[root@linuxbox me]#

[me@linuxbox me]$ sudo some_command
Password:
[me@linuxbox me]$

Changing File Ownership

[me@linuxbox me]$ su Password: [root@linuxbox me]# chown you some_file [root@linuxbox me]# exit [me@linuxbox me]$

Changing Group Ownership

[me@linuxbox me]$ chgrp new_group some_file





Job Control

  • ps – list the processes running on the system
  • kill – send a signal to one or more processes (usually to “kill” a process)
  • jobs – an alternate way of listing your own processes
  • bg – put a process in the background
  • fg – put a process in the forground

A Practical Example

xload

Putting A Program In The Background

xload & [1] 1223
bg
[2]+ xload &

Process’leri listeleme:

[code lang=”shell”] jobs [1]+ Running xload &amp; [/code] [code lang=”shell”] ps [/code] PID TTY TIME CMD 1211 pts/4 00:00:00 bash 1246 pts/4 00:00:00 xload 1247 pts/4 00:00:00 ps Tüm process’lerin özet açıklama ile listesi: [code lang=”shell”] ps -A [/code] Tüm process’lerin özet açıklama ile listesi: [code lang=”shell”] ps -e [/code] Tüm process’lerin tam açıklama ile listesi: [code lang=”shell”] ps -ef [/code] Tüm process’lerin ek açıklama ile listesi: [code lang=”shell”] ps -eF [/code] -eF ile aynı ıktıyı verir, GNU/Linux yöneticileri ve bazı kullanıcılar tarafından daha fazla tercih edilir. ilgili dosyanın nerede olduğunun bulmak için ps ax | grep redis ps aux | grep redis [code lang=”shell”] ps aux [/code] Daha fazla detay için burayı inceleyebilirsiniz.

Process’leri Öldürme/Sonlandırma:

xload & [1] 1292 jobs [1]+ Running xload & kill %1 xload & [2] 1293 [1] Terminated xload ps PID TTY TIME CMD 1280 pts/5 00:00:00 bash 1293 pts/5 00:00:00 xload 1294 pts/5 00:00:00 ps kill 1293 [2]+ Terminated xload

A Little More About kill

kill -l
Signal # Name Description
1 SIGHUP Hang up signal. Programs can listen for this signal and act upon it. This signal is sent to processes running in a terminal when you close the terminal.
2 SIGINT Interrupt signal. This signal is given to processes to interrupt them. Programs can process this signal and act upon it. You can also issue this signal directly by typing Ctrl-c in the terminal window where the program is running.
15 SIGTERM Termination signal. This signal is given to processes to terminate them. Again, programs can process this signal and act upon it. This is the default signal sent by the kill command if no signal is specified.
9 SIGKILL Kill signal. This signal causes the immediate termination of the process by the Linux kernel. Programs cannot listen for this signal.


ps x | grep bad_program
PID TTY STAT TIME COMMAND
2931 pts/5 SN 0:00 bad_program

kill -SIGTERM 2931

kill -SIGKILL 2931

kill 2931

kill -9 2931
wc -l fileName 6513 fileName dosya içerisindeki satır sayısını bildirir
]]>

Leave a Reply

Your email address will not be published. Required fields are marked *