{"id":147,"date":"2008-10-05T10:05:00","date_gmt":"2008-10-05T08:05:00","guid":{"rendered":"http:\/\/antynet.pl\/index.php\/2008\/10\/05\/linux-commands\/"},"modified":"2010-08-24T22:43:44","modified_gmt":"2010-08-24T20:43:44","slug":"linux-commands","status":"publish","type":"post","link":"https:\/\/www.antynet.pl\/index.php\/2008\/10\/05\/linux-commands\/","title":{"rendered":"LINUX COMMANDS"},"content":{"rendered":"<table class=\"tbl\">\n<tbody>\n<tr>\n<td>tail -f [plik]<\/td>\n<td>show file online<\/td>\n<\/tr>\n<tr>\n<td>ctrl + C, fg [nr jobs], jobs<\/td>\n<td>background process manager>\/td><\/td>\n<\/tr>\n<tr>\n<td>iptables -L -t nat -v|drop<\/td>\n<td>list all rules from chain nat without drop<\/td>\n<\/tr>\n<tr>\n<td>iptables -m [cel] &#8211;help<\/td>\n<td>goal desc<\/td>\n<\/tr>\n<tr>\n<td>sort -u<\/td>\n<td>sort and output only unique rows<\/td>\n<\/tr>\n<tr>\n<td>ctrl z<\/td>\n<td>pause<\/td>\n<\/tr>\n<tr>\n<td>bg [program]<\/td>\n<td>put on background<\/td>\n<\/tr>\n<tr>\n<td>jobs<\/td>\n<td>show background jobs<\/td>\n<\/tr>\n<tr>\n<td>fg [nr z jobs]<\/td>\n<td>recover from background<\/td>\n<\/tr>\n<tr>\n<td>find \/ -perm +4000<\/td>\n<td>search files with setuid for owner, 2000 for group<\/td>\n<\/tr>\n<tr>\n<td>find -perm -002 -mtime,-atime,-ctime -n,+n<\/td>\n<td>search files with write privilege at least, -mtime (modyfy),-atime (access),-ctime(time change privileges),-n (within n days),+n (more then n days ago)<\/td>\n<\/tr>\n<tr>\n<td>find \/ -name plik -exec \/bin\/execfile {} \\;<\/td>\n<td>run execfile on search file<\/td>\n<\/tr>\n<tr>\n<td>find -type d -exec \/bin\/chmod 774 {} \\;<\/td>\n<td>change privileges only on directories<\/td>\n<\/tr>\n<tr>\n<td>lspci<\/td>\n<td>listuje urz\u0105dzenia dla pci podobnie lsusb<\/td>\n<\/tr>\n<tr>\n<td>date[opcje], hwclock &#8211;systohc<\/td>\n<td>konfiguracja daty<\/td>\n<\/tr>\n<tr>\n<td>strobe<\/td>\n<td>skanowanie<\/td>\n<\/tr>\n<tr>\n<td>scripts<\/td>\n<td>wyci\u0105ganie tekstu z binarek<\/td>\n<\/tr>\n<tr>\n<td>file [plik]<\/td>\n<td>pokazanie rodzaju pliku<\/td>\n<\/tr>\n<tr>\n<td>file -s [raw_device]<\/td>\n<td>pokazanie filesystemu<\/td>\n<\/tr>\n<tr>\n<td>md5sum -b [plik]<\/td>\n<td>suma md5 z pliku<\/td>\n<\/tr>\n<tr>\n<td>lsmod<\/td>\n<td>lista modu\u0142\u00f3w<\/td>\n<\/tr>\n<tr>\n<td>strings [plik]<\/td>\n<td>wypisanie np. z pliku w C ciag\u00f3w znak\u00f3w<\/td>\n<\/tr>\n<tr>\n<td>uniq -d<\/td>\n<td>wypisuje tylko linie powtarzajace sie<\/td>\n<\/tr>\n<tr>\n<td>strace [polecenie] 2> [plik]<\/td>\n<td>zapis w [plik] informaciji o wykonywanych przez polecenie instrukcjach<\/td>\n<\/tr>\n<tr>\n<td>strace -f -e open [polecenie]<\/td>\n<td>jw tyko -f procesy potomne, -e open otwierane pliki<\/td>\n<\/tr>\n<tr>\n<td>echo &#8222;$((`date -d &#8217;10 mar&#8217; +%s`-`date +%s`))\/86400&#8243;|bc<\/td>\n<td>obliczanie dni pomi\u0119dzy okre\u015blonymi datami<\/td>\n<\/tr>\n<tr>\n<td>zcat \/usr\/src\/2.4.32-libata1.patch.gz | patch -p1<\/td>\n<td>patchowanie j\u0105dra &#8211; bed\u0105c w katalogu ze \u017ar\u00f3dlami<\/td>\n<\/tr>\n<tr>\n<td>logger [tekst]<\/td>\n<td>wpis do log\u00f3w dowolnego tekstu<\/td>\n<\/tr>\n<tr>\n<td>sed -e&#8217;s\/a\/\/g&#8217;<\/td>\n<td>edytor liniowy<\/td>\n<\/tr>\n<tr>\n<td>shc -f<\/td>\n<td>kompilacja plik\u00f3w w bashu<\/td>\n<\/tr>\n<tr>\n<td>expect<\/td>\n<td>automatyczne wykonywanie program\u00f3w<\/td>\n<\/tr>\n<tr>\n<td>which [polecenie]<\/td>\n<td>\u015bcie\u017cka polecenia<\/td>\n<\/tr>\n<tr>\n<td>locate [plik]<\/td>\n<td>proste wyszukiwanie pliku<\/td>\n<\/tr>\n<tr>\n<td>man -k [slowo],apropos [slowo]<\/td>\n<td>wyszukiwanie manuali w kt\u00f3rych wyst\u0119puje [slowo]<\/td>\n<\/tr>\n<tr>\n<td>\/proc\/sys\/kernel\/printk<\/td>\n<td>ustawienia dotyczace komunikatow<\/td>\n<\/tr>\n<tr>\n<td>mbmon<\/td>\n<td>odczyty z czujnikow na plycie glownej<\/td>\n<\/tr>\n<tr>\n<td>ab<\/td>\n<td>testowanie serwera Apache<\/td>\n<\/tr>\n<tr>\n<td>mii-tools<\/td>\n<td>testowanie linkow<\/td>\n<\/tr>\n<tr>\n<td>tcpdump -D<\/td>\n<td>wypisuje wszystkie interfejsy<\/td>\n<\/tr>\n<tr>\n<td>tcpdump 'tcp[tcpflags] &#038; {tcp-syn) !=0&#8242;<\/td>\n<td>nas\u0142uch pakietow SYN<\/td>\n<\/tr>\n<tr>\n<td>tcpdump -nv dst <ip> and 'icmp[icmptype] = icmp=echo&#8217;<\/ip><\/td>\n<td>nas\u0142uch tylko icmp-echo<\/td>\n<\/tr>\n<tr>\n<td>hdparm -it \/dev\/hda<\/td>\n<td>testowanie pr\u0119dko\u015bci dysku<\/td>\n<\/tr>\n<tr>\n<td>iperf -s|iperf -c [IP servera]<\/td>\n<td>testowanie pr\u0119dko\u015bci \u0142\u0105cza komendy odpowiednio dla serwera i dla klienta<\/td>\n<\/tr>\n<tr>\n<td>ethtool<\/td>\n<td>zestawienie kart sieciowych<\/td>\n<\/tr>\n<tr>\n<td>type [program]<\/td>\n<td>pokazuje \u015bcie\u017ck\u0119 do programu<\/td>\n<\/tr>\n<tr>\n<td>SVGAtextmode 80x40x9<\/td>\n<td>ustawianie rozdielczo\u015bci pod konsol\u0105<\/td>\n<\/tr>\n<tr>\n<td>cfdisk \/dev\/hda1<\/td>\n<td>do kasowania i tworzenia partycji<\/td>\n<\/tr>\n<tr>\n<td>mkfs  -t xfs -f \/dev\/hda1<\/td>\n<td>do formatowania partycji<\/td>\n<\/tr>\n<tr>\n<td>man [polecenie]| col -b >[plik]<\/td>\n<td>zamiana mana na plik tekstowy<\/td>\n<\/tr>\n<tr>\n<td>ldd [polecenie]<\/td>\n<td>pokazuje z jakich bibliotek korzysta polecenie<\/td>\n<\/tr>\n<tr>\n<td>dpkg &#8211;get-selections &#8222;*&#8221;<\/td>\n<td>wy\u015bwietla list\u0119 zainstalowanych pakiet\u00f3w<\/td>\n<\/tr>\n<tr>\n<td>watch<\/td>\n<td>powtarzanie polecen z wyswietlaniem wyniku na konsole<\/td>\n<\/tr>\n<tr>\n<td>mysql>load data local infile '[path_do_pliku]&#8217; into table [nazwa_tabeli] fields terminated by '[znak]'([kolumna1],[kolumna2]);<\/td>\n<td>wrzut danych do tabeli mysql<\/td>\n<\/tr>\n<tr>\n<td>ps auxSwwf<\/td>\n<td>pokazuje procesy z wykorzystaniem zasobow, w strukturze zaleznosci<\/td>\n<\/tr>\n<tr>\n<td>dpkg-reconfigure locales<\/td>\n<td>rekonfiguracja ustawie\u0144 lokalnych<\/td>\n<\/tr>\n<tr>\n<td>cp \/usr\/share\/zoneinfo\/Europe\/Poland \/etc\/localtime<\/td>\n<td>zmiana ustawie\u0144 strefy czasowej<\/td>\n<\/tr>\n<tr>\n<td>locale<\/td>\n<td>wy\u015bwietlenie ustawie\u0144 lokalnych, w cudzys\u0142owie te kt\u00f3re pobierane ze zmiennej LANG, bez cudzys\u0142owia te konfigurowalne indywidualnie<\/td>\n<\/tr>\n<tr>\n<td>locale -a<\/td>\n<td>wy\u015bwietlenie dost\u0119pnych ustawie\u0144<\/td>\n<\/tr>\n<tr>\n<td>gbd<\/td>\n<td>debuger c<\/td>\n<\/tr>\n<tr>\n<td>netselect-apt<\/td>\n<td>wyb\u00f3r najszybszego repozytorium<\/td>\n<\/tr>\n<tr>\n<td>tzconfig,tzselect<\/td>\n<td>konfiguracja strefy czasowej<\/td>\n<\/tr>\n<tr>\n<td>dircolors -p >.dircolorseval `dircolors -b .dircolors`<\/td>\n<td>zmiana kolor\u00f3w plikow<\/td>\n<\/tr>\n<tr>\n<td>smbclient -L [serwername] -U [user] -W [workgroup]<\/td>\n<td>przegl\u0105danie zasob\u00f3w na serwerze w$<\/td>\n<\/tr>\n<tr>\n<td>mount -t cifs \/\/[serwername]\/[share] \/[mount_point]<\/td>\n<td>montowanie zasob\u00f3w w$<\/td>\n<\/tr>\n<tr>\n<td>dos2unix [file]<\/td>\n<td>konwersja plik\u00f3w z w$<\/td>\n<\/tr>\n<tr>\n<td>dmidecode |grep MB<\/td>\n<td>sprawdzanie podpi\u0119cia pami\u0119ci<\/td>\n<\/tr>\n<tr>\n<td>dmidecode -s<\/td>\n<td>sprawdzanie wersji biosu, chassis,serwer,tag etc.<\/td>\n<\/tr>\n<tr>\n<td>blkid<\/td>\n<td>sprawdzanie uuid, label urz\u0105dze\u0144 blokowych<\/td>\n<\/tr>\n<tr>\n<td>unset<\/td>\n<td>usuwanie zmiennych \u015brodowiskowych<\/td>\n<\/tr>\n<tr>\n<td>chkconfig &#8211;list<\/td>\n<td>sprawdzenie uruchamianych us\u0142ug<\/td>\n<\/tr>\n<tr>\n<td>basename<\/td>\n<td>wyciaganie samej nazwy bez \u015bcie\u017cki<\/td>\n<\/tr>\n<tr>\n<td>echo ${zm:0:3}<\/td>\n<td>wyci\u0105ganie ze zmiennej zm od 1 do 3 pozycji w prawo<\/td>\n<\/tr>\n<tr>\n<td>command1 &#038;&#038; command2<\/td>\n<td>gdy wynik b\u0142\u0119du z command1 jest 0 to wykonuje command2<\/td>\n<\/tr>\n<tr>\n<td>command1 || command2<\/td>\n<td>gdy wynik b\u0142\u0119du z command1 jest r\u00f3\u017cne od 0 to wykonuje command2<\/td>\n<\/tr>\n<tr>\n<td>tarowanie z wykluczeniem plikow<\/td>\n<td>tar -cf [archive_name].tar [dir_path] &#8211;exclude [dir_path]\/[exclude_dir] &#8211;exclude [dir_path]\/[exclude_dir]<\/td>\n<\/tr>\n<tr>\n<td>tarowanie z usuni\u0119ciem i wyszukaniem<\/td>\n<td>tar &#8211;remove-file -czf [archive_name].tar.gz -C [dir_path] `find [dir_path] -name &#8222;[name]\\.*&#8221; -exec basename {} \\;`<\/td>\n<\/tr>\n<tr>\n<td>tarowanie logow<\/td>\n<td>find [dir_logpath] -mtime 18 -exec tar &#8211;remove &#8211;append &#8211;file=[destination_path]\/filename`date -d &#8222;18 days ago&#8221; +%F`.tar {} \\;<\/td>\n<\/tr>\n<tr>\n<td>sprawdzenie zawarto\u015bci<\/td>\n<td>tar -tf [plik].tar<\/td>\n<\/tr>\n<tr>\n<td>sprawdzenie alias\u00f3w<\/td>\n<td>alias -p<\/td>\n<\/tr>\n<tr>\n<td>szukanie plik\u00f3w w bie\u017c\u0105cym katalogu zmodyfikowanych mi\u0119dzy 495 a 312 dniem<\/td>\n<td>find .\/ -maxdepth 1 -mtime +312 -mtime -495 -exec basename {} \\;<\/td>\n<\/tr>\n<tr>\n<td>dodawanie plik\u00f3w do istniej\u0105cego archiwum<\/td>\n<td>tar &#8211;append &#8211;file=[archiwum].tar plik<\/td>\n<\/tr>\n<tr>\n<td>\u0142adnie sformatowany output z basha<\/td>\n<td>awk '{printf(&#8222;%-25s%-10s%-10s%-10s%\\n&#8221;,$1,$2,$3,$4)}&#8217;<\/td>\n<\/tr>\n<tr>\n<td>ethtool -s eth0 speed 10 duplex half autoneg off<\/td>\n<td>zmiana ustawie\u0144 karty<\/td>\n<\/tr>\n<tr>\n<td>ETHTOOL_OPTS=&#8221;autoneg off speed 100 duplex full&#8221;<\/td>\n<td>wpis do ifcfg-ethx<\/td>\n<\/tr>\n<tr>\n<td>ssh-keygen -t rsa<br \/>cat id_rsa.pub >> .ssh\/authorized_keys<\/td>\n<td>generacja kluczy (pc local)<br \/>do\u0142\u0105czenie klucza do zaufanych (pc remote)<\/td>\n<\/tr>\n<tr>\n<td>alternatives &#8211;install \/usr\/lib\/mozilla\/plugins\/libjavaplugin.so libjavaplugin.so \/usr\/java\/jdk1.6.0_17\/jre\/plugin\/i386\/ns7\/libjavaplugin_oji.so 2<\/td>\n<td>add symbolic link \/usr\/lib\/mozilla\/plugins\/libjavaplugin.so to alternatives with name libjavaplugin.so and with source \/usr\/java\/jdk1.6.0_17\/jre\/plugin\/i386\/ns7 and priority 2<\/td>\n<\/tr>\n<tr>\n<td>change default priority<\/td>\n<td>alternatives &#8211;config libjavaplugin.so<\/td>\n<\/tr>\n<tr>\n<td>check alternatives<\/td>\n<td>alternatives &#8211;display libjavaplugin.so<\/td>\n<\/tr>\n<tr>\n<td>chkconfig [command]<br \/>\non<\/td>\n<td>turn on command during start<\/td>\n<\/tr>\n<tr>\n<td>partprobe<\/td>\n<td>refresh table partitions<\/td>\n<\/tr>\n<tr>\n<td>cpio -t < file.cpio<br \/>cpio -id  < file.cpio<\/td>\n<td>check cpio<br \/>unpack cpio<\/td>\n<\/tr>\n<tr>\n<td>getfacl [dir] | [file]<\/td>\n<td>show extended acl list<\/td>\n<\/tr>\n<tr>\n<td>setfacl -m user:[user]:rwx [dir] | [file]<\/td>\n<td>set extended acl<\/td>\n<\/tr>\n<tr>\n<td>vmstat [delay] [how_many]<\/td>\n<td>virtual memory stats<\/td>\n<\/tr>\n<tr>\n<td>iostat [delay] [how_many]<\/td>\n<td>cpu and i\/o stats<\/td>\n<\/tr>\n<tr>\n<td>sar [delay] [how_many]<\/td>\n<td>collected stats<\/td>\n<\/tr>\n<tr>\n<td>sar -r<\/td>\n<td>collected mem stats<\/td>\n<\/tr>\n<tr>\n<td>pwck,grpck<\/td>\n<td>verify passwd and group file<\/td>\n<\/tr>\n<tr>\n<td>paste file1 file2 > file3<\/td>\n<td>concatenate files by columns<\/td>\n<\/tr>\n<tr>\n<td>cut -f3 file<\/td>\n<td>get 3-rd column from file<\/td>\n<\/tr>\n<tr>\n<td>cut -c3-5 file<\/td>\n<td>get 3-5 character from file<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>tail -f [plik] show file online ctrl + C, fg [nr jobs], jobs background process manager>\/td> iptables -L -t nat -v|drop list all rules from chain nat without drop iptables -m [cel] &#8211;help goal desc sort -u sort and output only unique rows ctrl z pause bg [program] put on background jobs show background jobs [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[4],"tags":[65],"class_list":["post-147","post","type-post","status-publish","format-standard","hentry","category-sciaga-admina","tag-linux-commands"],"_links":{"self":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/posts\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/comments?post=147"}],"version-history":[{"count":1,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/posts\/147\/revisions"}],"predecessor-version":[{"id":203,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/posts\/147\/revisions\/203"}],"wp:attachment":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/media?parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/categories?post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/tags?post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}