Linux

Temel Linux Komutları

Bu yazıda yeni başlayan arkadaşlara kolaylık olması açısından, linux kullanan herkesin bilmesi gereken temel linux komutlarını paylaşıyorum. Böylelikle yeni başlayan arkadaşlar bu komutları öğrenerek linux dünyasına giriş yapabilir. Aşağıdaki listeye eklenmesi gereken komut var ise yorum olarak belirtirseniz “Ek komutlar” bölümüne ekleyebiliriz.

Linux Coder Developer
Linux Coder Developer

Temel Linux Sistem Komutları

id

Programı kimin kullandığını gösterir.

root@linux:~# id
uid=0(root) gid=0(root) groups=0(root)
root@linux:~#

uname -a

Kernel ismi, hostname, kernel sürümü, kernel versiyonu gibi bilgileri verir.

root@debian:~# uname -a
Linux debian 4.9.0-debian3-686-pae #1 SMP Debian 4.9.18-1debian1 (2017-04-04) i686 GNU/Linux
root@debian:~#

lsb_release -a

Yüklenen linux’ün detaylarını gösterir.

root@debian:~# lsb_release -a
No LSB modules are available.
Distributor ID: debian
Description: debian GNU/Linux Rolling
Release: debian-rolling
Codename: debian-rolling
root@debian:~#

Temel Linux Network Komutları

ifconfig

Network bilgisini ayrıntılarıyla gösterir.

root@debian:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0b:29:9c:c9:b3
inet addr:192.168.1.23 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:ff9b:c9a3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:292216 errors:0 dropped:0 overruns:0 frame:0
TX packets:135628 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:431730275 (411.7 MiB) TX bytes:7398306 (7.0 MiB)
Interrupt:19 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:26 errors:0 dropped:0 overruns:0 frame:0
TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1648 (1.6 KiB) TX bytes:1648 (1.6 KiB)

root@debian:~#

route -n

Route tablosunu gösterir.

root@debian:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.2 0.0.0.0 UG 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
root@debian:~#

cat /etc/resolv.conf

DNS bilgilerini gösterir.

root@debian:~# cat /etc/resolv.conf
# Generated by NetworkManager
domain localdomain
search localdomain
nameserver 192.168.1.2
root@debian:~#

cat /etc/network/interfaces

Network aygıtları ayarlarını gösterir.

root@debian:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback
root@debian:~#

cat /etc/hosts

Host sorgularındaki statik değerleri gösterir.

root@debian:~# cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 debian-offsec

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
root@debian:~#

Donanım ile ilgili temel komutlar

lspci

Tüm PCI aygıtları (ör: iç donanımı) listeler.

root@debian:~# lspci
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX – 82443BX/ZX/DX Host bridge (rev 01)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX – 82443BX/ZX/DX AGP bridge (rev 01)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)
00:0f.0 VGA compatible controller: VMware SVGA II Adapter
00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01)
02:00.0 USB controller: VMware USB1.1 UHCI Controller
02:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 10)
02:02.0 Multimedia audio controller: Ensoniq ES1371 [AudioPCI-97] (rev 02)
02:03.0 USB controller: VMware USB2 EHCI Controller
02:05.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 10)
root@debian:~#

lsusb

Tüm usb cihazlarını listeler

root@debian:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
root@debian:~#

dmesg

Kernel bufferı (yani kernel kayıtlarını) listeler. Bu komut büyük bir sonuç döndürebilir o yüzden grep komutu ile kullanılması daha iyi olur.

root@debian:~# dmesg
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.12-debian1-686-pae (debian-kernel@lists.debian.org) (gcc version 4.7.2 (Debian 4.7.2-5) ) #1 SMP Debian 3.12.6-2debian1 (2014-01-06)
[ 0.000000] Disabled fast string operations
…snip…
[ 3.367400] EXT4-fs (sda1): re-mounted. Opts: (null)
[ 3.407412] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro
[ 3.499360] loop: module loaded
[ 4.180582] Netfilter messages via NETLINK v0.30.
[ 4.350865] pcnet32 0000:02:01.0 eth0: link up
[ 5.224520] pcnet32 0000:02:05.0 eth1: link up
[ 7.826665] [drm] width 1024
[ 7.826704] [drm] height 768
[ 7.826716] [drm] bpp 32
[ 7.826771] [drm] Fifo max 0x00200000 min 0x00001000 cap 0x0000077f
[ 7.843755] [drm] width 1024
[ 7.843764] [drm] height 768
[ 7.843771] [drm] bpp 32
[ 7.843827] [drm] Fifo max 0x00200000 min 0x00001000 cap 0x0000077f
[ 187.769500] sda1: WRITE SAME failed. Manually zeroing.
root@debian:~#

lsmod

Linux kernel e yüklü modüllerin durumunu gösterir. (Hangi sürücülerin yüklendiği gibi.)

root@debian:~# lsmod
Module Size Used by
nfnetlink_log 17065 0
nfnetlink 12853 1 nfnetlink_log
binfmt_misc 12733 1
loop 21962 0
dm_crypt 22008 0
hid_generic 12369 0
usbhid 39684 0
hid 80998 2 hid_generic,usbhid
vmw_balloon 12502 0
psmouse 76538 0
serio_raw 12737 0
coretemp 12734 0
evdev 17172 4
parport_pc 25991 0
parport 35171 1 parport_pc
processor 27662 0
battery 12949 0
ac 12588 0
thermal_sys 22960 1 processor
snd_ens1371 22679 2
mptbase 68288 2 mptspi,mptscsih
scsi_mod 151284 7 sg,scsi_transport_spi,libata,mptspi,sd_mod,sr_mod,mptscsih
root@debian:~#

Linux Kablosuz Ağ Komutları

airmon-ng –verbose

airmon-ng nin modifiyeli halidir. Kablosuz ağı monitor etmeye, yani izlemeye yarar.

root@debian ~$ airmon-ng –verbose

Linux debian 3.12-debian1-686-pae #1 SMP Debian 3.12.6-2debian1 (2014-01-06) i686 GNU/Linux
Detected VM using lscpu
This appears to be a VMware Virtual Machine
If your system supports VT-d, it may be possible to use PCI devices
If your system does not support VT-d, you can only use USB wifi cards

K indicates driver is from 3.12-debian1-686-pae
V indicates driver comes directly from the vendor, almost certainly a bad thing
S indicates driver comes from the staging tree, these drivers are meant for reference not actual use, BEWARE
? indicates we do not know where the driver comes from… report this

X[PHY]Interface Driver[Stack]-FirmwareRev Chipset Extended Info

K[phy0]wlan0 rt73usb[mac80211]-1.7 Linksys WUSB54GC v1 802.11g Adapter [Ralink RT73]

root@debian ~$

rfkill list

Kablosuz aygıtların (kablosuz internet, bluetooth gibi) durumunu görüntüler.

root@debian ~$ rfkill list
2: phy2: Wireless LAN
Soft blocked: no
Hard blocked: no
root@debian ~$

iwconfig

Kablosuz internetin içeriğini gösterir.

root@debian ~$ iwconfig
wlan0 IEEE 802.11bg ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:on

root@debian ~$

airmon-ng

Kablosuz kartları monitor moduna çevirmeye yarar.

root@debian ~$ airmon-ng

Interface Chipset Driver

wlan0 Ralink 2573 USB rt73usb – [phy1]

root@debian ~$

Diğer Komutlar

apt-get -y upgrade

Yorum Yapın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir