IDIVIDI forum Веб сајт
почетна страница почетна страница > Технологија > Хардвер и софтвер
  Активни теми Активни теми RSS - Linux команди
  најчести прашања најчести прашања  Пребарувај форум   Настани   Регистрирајте се Регистрирајте се  Влез Влез

Linux команди

 Внеси реплика Внеси реплика
Автор
Порака
ultra Кликни и види ги опциите
Сениор
Сениор
Лик (аватар)

Регистриран: 17.Март.2006
Статус: Офлајн
Поени: 2616
Опции за коментарот Опции за коментарот   Благодарам (0) Благодарам(0)   Цитирај ultra Цитирај  Внеси репликаОдговор Директен линк до овој коментар Тема: Linux команди
    Испратена: 02.Август.2006 во 09:36
< ="Content-" content="text/; charset=UTF-8"> < name="Generator" content="Kate, the KDE Advanced Text Editor">
MAL PREGLED NA NAREDBITE VO LINUX (se nadevam deka ke im pomogne na pocetnicite (tuka i jas spagam))

Shell e vazna alatka vo Linux-ot. So davanje na naredbite vo Terminalot ili Konzolata moze pobrzo da se raboti otkolku preku voobicaenite metodi preku maus-ot i folder-ite.
Slednite Linux-naredbi se samo eden mal izvadok od mnogute naredbi koi vo sekojdnevnata rabota se dosta potrebni. Najdobro e da se isprobaat za da se sfati nivnoto znacenje.
Za site novajlii vo Linux-ot: Cesto se postavuva prasanjeto dali e naporno site tie naredbi i iminja na programi da se vtipuvaat... vo toj slucaj se vtipuva prvata/ite bukva/i i se stiska TAB-"kopce", "tast" (kako sakate kazete), taka da ostatokot sam se pojavuva. Na istiot nacin moze da se vidi dali nekoj program e instaliran.

Da premineme na naredbite:

opsto:
[naredba] & Konzolata moze i ponatamu da se koristi firefox &
[naredba] && [naredba] Edno po drugo izvrsuvanje na naredbite firefox && shutdown -h now
man [programa} Pomos za odredena programa man firefox

papki i fajlovi:
cd [papka] preminuva vo dadenata papka cd /tmp
cd .. preminuva vo pogornata papka cd ../td
cd / preminuva vo "korenovata" (root) papka cd /
cd - preminuva vo prethodnata papka cd -
cp [fajl][papka] go kopira dadeniot fajl vo dad. papka cp 123.txt/tmp
mv pomestuva eden fajl mv 123.txt/tmp
mv [fajl1][fajl2] preimenuva eden fajl mv 123.txt 456.txt
rm brise eden fajl rm /tmp/123.txt ; rm /tmp/*
rm -rf brise se sto e vo edna papka rm -rf /tmp/
mkdir kreira papka mkdir /home/test
rmdir brise papka rmdir /home/test
ls ja pokazuva sodrzinata na papkata ls /home/test
ls -l dava detalna lista na papkata ls -l /home/test
ls -la gi lista site fajlovi vo papkata detalno ls -la /home/test
alias ls='ls --color' prikazuva vo boja alias ls='ls --color'
pwd ja pokazuva aktuelnata papka pwd
cat [fajl] ja pokazuva sodrzinata na eden fajl cat 123.txt
more [fajl] ja pokazuva sodrzinata na fajlot po strani more 123.txt
touch [fajl] kreira prazen fajl touch 123.txt
whereis [prog] bara program whereis Firefox
find . | grep [fajl] bara eden fajl vo papka find . | grep 123.txt
grep [KEY] [fajl] bara "klucen" zbor vo eden fajl grep Haus 123.txt
locate [fajl] bara fajl vo banka na fajlovi t.e. dati locate 123.txt
updatedb aktueliziranje nabankat na dati updatedb
which pokazuva kade se naoga dadenata programa which firefox

System
arch prozesorot od koja "familija" e arch
cat /proc/filesystems koj e podrzuvan fajlsistem cat /proc/filesystems
cat /proc/cpuinfo informacii za CPU-to cat /proc/cpuinfo
cat /proc/pci informacii za PCI-kartickite cat /proc/pci
dmesg | grep hd info. za hardisc-ot floppy cd-rom... dmesg | grep hd
date datum i vreme date
dmesg Kernellogger: gi pokazuva aktivnostite na kernel-ot mesg
free ja pokazuva iskoristenosta na rab. memorija free
glxgears mal test za performansite na VGA glxgears
glxinfo podatoci za OpenGL i grafickata karticka glxinfo
kill [PID] zatvara eden proces so odredena ID kill 1067
killall [Prog] go zatvara dadeniot proces killall Firefox
lspci info za PCI-komponentite lspci
shutdown -h now go "zatvara" PC-to shutdown -h now
shutdown -r now rebotuva shutdown -r now
top gi pokazuva programite i CPU-optovaruvanjeto top
uptime kolku vreme raboti PC-to uptime
X -version ja pokazuva verzijata na Xfree X -version

Harddisc
df ja pokazuva zafatenosta df -h
fdisk particioniranje na hardisc-ot fdisk /dev/hda
mkfs.ext2 formatiranje na HDD so ext2 mkfs.ext2 /dev/hda1
mkfs.ext3 formatiranje na HDD so ext3 mkfs.ext3 /dev/hda1
mkreiserfs formatiranje na HDD so reiserfs mkreiserfs /dev/hda1

Mount
mount zakacuva nosac na dati t.e podatoci mount /dev/hda1 /mnt/win
mount -t [Filesystem] Mount-uva so prethodno daden Filesystem mount -t ntfs /mnt/win_xp
mount -a gi Mount-uva site nosaci na pod. od /etc/fstab mount -a
mount -r od nosacot na pod. moze samo da se cita mount -r /mnt/win
mount -w dozvoleno citanje i pisuvanje na nosacot na pod. mount -w /mnt/win
mount -n Mount-uva bez vnesuvanje vo /etc/mtab mount -n /mnt/win

Korisnici
id go pokazuva kor. ime i grupata id
whoami go pokazuva aktuelniot, prijaven korisnik whoami
who koj sve e logiran who
groupadd [Grupa] kreira nova grupa groupadd admins
groupdel [Grupa] brise ena grupa groupdel admins
useradd -m [USER] kreira korisnik i "domasna" papka useradd -m chef
userdel -r [USER] brise korisnik i "dom" papka useradd -m chef
passwd [USER] go menuva pasvordot na korisnikot passwd chef
su koristenje na konzolata kako administrator su
su [USER] koristenje na konzolata kako obiocen korisnik su chef

Mreza
ifconfig gi pokazuva informaciite za mrezata ifconfig
iwconfig ifo za WLAN iwconfig
ping [PC] testira povrzuvanje so eden PC ping 192.168.0.1

Kernel i Moduli
lsmod gi pokazuva modulite lsmod
make menuconfig sreduvanje na kernel-ot cd /usr/src/linux;
make menuconfig
modprobe [Modul] polni eden Modul modprobe printer
uname -a ja pokazuva verzijata na Kernel-ot uname -a

drugo...
ps aux gi pokazuva site procesi i "usluzni programi" ps aux
rc-update show gi pokazuva "usluznite" prog. sto se polnat pri Start rc-update show


Изменето од влечка - 02.Август.2006 во 09:42
Кон врв
ultra Кликни и види ги опциите
Сениор
Сениор
Лик (аватар)

Регистриран: 17.Март.2006
Статус: Офлајн
Поени: 2616
Опции за коментарот Опции за коментарот   Благодарам (0) Благодарам(0)   Цитирај ultra Цитирај  Внеси репликаОдговор Директен линк до овој коментар Испратена: 23.Август.2006 во 09:27
vaka sega...

Posto ionaka nema mnogu zainteresirani, prodolzuvam so vi - Referenc-Listata bez da ja preveduvam...

Mal predgovor za vi.
vi e najobicen editor i se sto se pisuva bez razlika dali e programa vo C, C++, java ili LaTeX se pisuva vo vi. Moze i drugi editori da se koristat ama vi se koristi vo site linux platformi.



Кон врв
natalija Кликни и види ги опциите
Сениор
Сениор
Лик (аватар)
Министерка за гушкање

Регистриран: 26.Јули.2005
Статус: Офлајн
Поени: 13319
Опции за коментарот Опции за коментарот   Благодарам (0) Благодарам(0)   Цитирај natalija Цитирај  Внеси репликаОдговор Директен линк до овој коментар Испратена: 23.Август.2006 во 09:45
Имаше нешто слична тема мила влечка, само ретко кој работи на конзола..или терминал како сакаш кажи го..
Се ова ми е многу добро познато, само продолжи понатаму
Кон врв
ultra Кликни и види ги опциите
Сениор
Сениор
Лик (аватар)

Регистриран: 17.Март.2006
Статус: Офлајн
Поени: 2616
Опции за коментарот Опции за коментарот   Благодарам (0) Благодарам(0)   Цитирај ultra Цитирај  Внеси репликаОдговор Директен линк до овој коментар Испратена: 23.Август.2006 во 09:50

                                            VI                                                                 

Syntax explanations

Strings or characters in bold must be entered on the command line of the vi
as they are. Clauses in italic must be replaced by the actual name, character
or number. vi commands are enclosed in <...>. They are not visable when
entered. Ctrl -c means that both the <Ctrl> key and the ’c’ key must be pressed.

Invoking vi
vi                                Enters the vi editor
vi filename                  Enters vi and edits file filename
vi +n filename             Edits file filename and positions cursor at line n
vi -r filename              Restores changes to filename caused by system interrupt
vi fn1 fn2 ...               Edits multiple files fn1, fn2, ...
vi -R filename            Views contents of file filename same as view filename

Save changes and/or exit from vi
:q!                            Quits the editor unconditionally
:q                             Quits the editor if last changes were written
:wq                          Writes the file and quits the editor
ZZ                            Writes the file and quits the editor
:w                             Writes the changes onto file
:w newname             Writes data onto new file newname

Adusting the screen within vi
Ctrl -F or Ctrl -f          Moves one full screen forward (#)
Ctrl -D or Ctrl -d         Moves a half screen forward (#)
Ctrl -E or Ctrl -e          Moves one line forward (#)
Ctrl -B or Ctrl -b          Moves one full screen backward (")
Ctrl -U or Ctrl -u         Moves a half screen backward (")
Ctrl -Y or Ctrl -y          Moves one line backward (")
< 1G >                      Moves to the top of the file
< G >                         Move to the bottom of the file

Cursor positioning
Following commands can be used besides the cursor keys  

... within the file
:n or < nG >             Moves cursor to the begin of line n
:1 or < 1G >             Moves cursor to the top of the file
< G >                        Moves cursor to the begin of the last line
< n| >                        Moves cursor to column n

... within the window
< H >                        Moves cursor to upper left corner of screen
< nH >                      Moves cursor to line n from top of screen
< M >                        Moves cursor to middle of screen
< L >                         Moves cursor to lower left corner of screen
< nL >                       Moves cursor to line n from bottom of screen

... by character
< h > or Ctrl -H
< BACKSPACE >     Moves cursor one character to left
< l >
< SPACE >           Moves cursor one character to right
< Fc >                  Moves cursor left to character c (Find)
< fc >                   Moves cursor right to character c
< Tc >                  Moves cursor left to character just after c (Tight)
< tc >                  Moves cursor right to character just before c

... by word
< e >                  Moves cursor to end of word (End)
< b >                  Moves cursor to beginning of previous word (Begin)
< w >                 Moves cursor to beginning of next word

... by line
< j > or Ctrl -N    Moves cursor down one line (Next)
< k > or Ctrl -P    Moves cursor up one line (Previous)
< 0 >                  Moves cursor to beginning of line
< $ >                  Moves cursor to end of line
< + >                  Moves cursor to beginning of next line
< >                   Moves cursor to beginning of previous line

... by sentence or paragraph
< ( >                    Moves cursor to beginning of sentence
< ) >                    Moves cursor to beginning of next sentence
< { >                   Moves cursor to beginning of paragraph
< } >                   Moves cursor to beginning of next paragraph


prodolzuva...



Изменето од влечка - 23.Август.2006 во 09:59
Кон врв
ultra Кликни и види ги опциите
Сениор
Сениор
Лик (аватар)

Регистриран: 17.Март.2006
Статус: Офлајн
Поени: 2616
Опции за коментарот Опции за коментарот   Благодарам (0) Благодарам(0)   Цитирај ultra Цитирај  Внеси репликаОдговор Директен линк до овој коментар Испратена: 23.Август.2006 во 09:52
Originally posted by natalija natalija напиша:

Имаше нешто слична тема мила влечка, само ретко кој работи на конзола..или терминал како сакаш кажи го..
Се ова ми е многу добро познато, само продолжи понатаму


Ako neka stoi, moze na nekoj ke mu pritreba pa duri sto se vika i jas mozam ovde da se potsekam... posto se na pamet ne se znae....

Fala za podrskata
Кон врв
ultra Кликни и види ги опциите
Сениор
Сениор
Лик (аватар)

Регистриран: 17.Март.2006
Статус: Офлајн
Поени: 2616
Опции за коментарот Опции за коментарот   Благодарам (0) Благодарам(0)   Цитирај ultra Цитирај  Внеси репликаОдговор Директен линк до овој коментар Испратена: 23.Август.2006 во 10:47
...prodolzenie...

Inserting text (Input Mode)
Following commands switch to input mode where every character is taken as is. To return to command mode, press the <ESC> key.
< i >                                       Inserts text immediately before cursor
< I >                                      Inserts text at beginning of line
< a >                                      Appends text immediately after cursor
< A >                                      Appends text to the end of the line
< o >                                      Inserts text below current line
< O >                                      Inserts text above current line

Commands within the input mode
< ESC >                                  Exits input mode, returns to command mode
< BACKSPACE >                    Deletes current input character
< ENTER >                              Creates a new line

Deleting text
< nx >                                    Deletes n characters starting at cursor
< nX >                                    Deletes n characters to left of cursor
< ndd >                                  Deletes n lines starting at current line
< D >                                      Deletes from cursor to line end
< dM >                                    Deletes from cursor to unit of measurement M

Examples:
          d0     Deletes from cursor to beginning of line (0)
          dW    Deletes from cursor to end of word (W)
          dG     Deletes to bottom of file (G)
          d1G   Deletes to top of file (1G)

Modifying text
< r >                                      Replaces character under cursor
< R >                                     Write over old text beginning at cursor; press <ESC> to end
< s >                                     Replaces one character through any given number of characters (Substitute);
                                              press <ESC> to end
< S >                                     Replaces entire current line; press <ESC> to end
< C >                                     Changes rest of the line
< ˜ >                                     Switches lower to upper case or vice versa

Retrieving text
After text was deleted or noted, it can be retrieved from the buffer and inserted at the original place or elsewhere in the file.

< p >                                    Puts text immediately after cursor or below current line
< P >                                    Puts text immediately before cursor or above current line

Moving and copying text
For moving or copying text there are always two steps to do: first one has to define the range of text, that should be moved or copied, and then one has to define the new location of the text.

Move
Moving text means that the data at the original location is deleted. Thereby the data is saved in the buffer from were it could be retrieved and inserted into the text at the new location. The retrieve of the data from the buffer must be done before the buffer is rewritten.

      Examples:
            dd and P         Moves one line above current line
            3dd and p       Moves 3 lines after current line
            5x and p          Moves 5 characters after cursor

Another method is the use of the move command for which one has to know the linenumbers:

:m#                                           Moves current line after line with number #
:a,bm#                                       Moves range of lines a to b after line with number #

      Examples:
             :m3        Moves current line after line 3
             :1,3m$   Moves the range of line 1 to 3 to the bottom of the file

Copy
Copying text means that the data at the original location remains unchanged, but a copy is yanked into the buffer. From there it could be retrieved and inserted into the text at another location.. The retrieve of the data from the buffer must be done before the buffer is rewritten.

< Y >                                           Yanks actual line
< nyy >                                       Yanks from the current line n lines
< YM >                                         Yanks the range from the current line to the unit of measurement M

       Examples:
               Y and P        Copies one line above the current line
               3yy and p    Copies 3 lines after the current line
               YG and p     Copies range of data up to the bottom of the file after the current line

Another method is the use of the copy command for which one has to know the linenumbers:

:co#                                          Copies current line after line with number #
:a,bco#                                      Copies the range of line a to b after line number #

        Examples:
                :co3         Copies current line after line 3
                :1,3co$    Copies the range of line 1 up to 3 to the bottom of the file



...prodolzuva...
Кон врв
ultra Кликни и види ги опциите
Сениор
Сениор
Лик (аватар)

Регистриран: 17.Март.2006
Статус: Офлајн
Поени: 2616
Опции за коментарот Опции за коментарот   Благодарам (0) Благодарам(0)   Цитирај ultra Цитирај  Внеси репликаОдговор Директен линк до овој коментар Испратена: 23.Август.2006 во 14:15
...posledno prodolzenie...

Searching text
< /string >                           Searches for next appearence of string
< ?string >                          Searches backward for first appearence of string
< n >                                  Repeats last search
< N >                                  Repeats search in opposite direction
< / >                                   Repeats previous search in forward direction
< ? >                                  Repeats previous search in backward direction

Search and replace (global change)
< :s/str1/str2/g >              Replaces all occurences of str1 with str2 within the current line. If g (global) isn’t
                                          specified, only the first occurence is changed.
< :a,b s/str1/str2/g >         Replaces all occurences of str1 with str2 within the range of line a up to line b.
                                           If g(global) isn’t specified, only the first occurence is changed.

     Example:
            :1,$ s/resource/Ressource/g
            changes within the complete file all occurences of resource into Ressource. Instead of ’1,$’ one can use
            the % sign to define the complete file.
            The command :% s/resource/Ressource/g is therefore equivalent.

:g /str/ command                Searches within the complete file for str and runs command command on all the
                                           lines that match str.

       Example:
             :g /resource/ s//Ressource/g
             changes within the complete file all occurences of resource into Ressource.

:v /str/ command                 Runs command on all lines that do not match str
< & >                                  Repeats the last :s command

Working with multiple files
:r filename                           Reads in and inserts named file filename after current line
:w! filename                        Writes complete file onto file filename (Overwrite)
:a,bw! filename                   Writes a range of lines from line a up to line b onto the file filename

         Example :
               ’:10,15w! TT’         writes line 11 up to 15 onto file TT

:a,bw>> filename              Appends a range of line from line a up to line b to file filename
:n                                       Edits next file from argument list
:e filename                         Edits another file; return to current file with :e#
Ctrl -G                                Displays the filename and position within the current file

Executing shell commands
:sh                                   Creates a subshell. Return to editor with C-d or exit.
:!command                       Creates a shell and runs command command.
:r!command                     Creates a shell, runs command command and inserts the output of command after the cursor.
!!command                      Creates a shell, runs command command and substitutes the current line by the output of command.

Other usefull commands
< . >                               Repeats last command
< J >                              Joins following line to current line
< Jn >                            Joins following n-1 lines to current line
< u >                             Undo last change
< U >                             Restores current line

Using vi options
:set all                          Prints all option settings
:set option [value]         Sets option

Some usefull options are:
autowrite                     Enables autowrite function
ignorcase                    Ignores lowercase and uppercase on search operations
number                        Prints line numbers
showmode                  Shows the current mode (Input, Replace) at the lower right corner

Using vi macros
vi supports the definition of macros, that map a series of command to a characterstring. There are two types of macros: macros in command mode and macros in input mode.

Defining macros:
:map macroname commands                        macro in command mode
:map! macroname commands                       macro in input mode

      Example:
            ’:map Q :q!’                 now Q can be used to quit the editor unconditionally

Deleting macros:
:unmap macroname                                    for command mode macros
:unmap! macroname                                   for input mode macros
Кон врв
ZokiBoSS Кликни и види ги опциите
Сениор
Сениор
Лик (аватар)

Регистриран: 04.Август.2005
Статус: Офлајн
Поени: 240
Опции за коментарот Опции за коментарот   Благодарам (0) Благодарам(0)   Цитирај ZokiBoSS Цитирај  Внеси репликаОдговор Директен линк до овој коментар Испратена: 27.Август.2006 во 17:11
Влечка, браво за целиот труд за линукс командите,  мислам дека си можел да го пастираш линкот до соодветниот туториал, а ако веќе си сакал од тебе да бидат, да се потрудеше барем на македонски да преведиш, и да ги издвоиш битните од небитните скратени команди :) .. Сепак браво за времето и нервите :)
That What Doesn't Kill Me, Only Makes Me Stronger..!
Кон врв
ultra Кликни и види ги опциите
Сениор
Сениор
Лик (аватар)

Регистриран: 17.Март.2006
Статус: Офлајн
Поени: 2616
Опции за коментарот Опции за коментарот   Благодарам (0) Благодарам(0)   Цитирај ultra Цитирај  Внеси репликаОдговор Директен линк до овој коментар Испратена: 28.Август.2006 во 08:40
Fala, go sfakam ova kako podrska, a inace (moze ne ti se veruva) zensko sum.

Sto se odnesuva do vi-Referenc-Listata, ja imam kako ps dokument simnato od eden Institut za primeneta matematika, a ne ja prevedov posto nemam vreme, copy-paste rabotava e, so malo preureduvanje posto mi se izgubi tabelata...




Кон врв
ZokiBoSS Кликни и види ги опциите
Сениор
Сениор
Лик (аватар)

Регистриран: 04.Август.2005
Статус: Офлајн
Поени: 240
Опции за коментарот Опции за коментарот   Благодарам (0) Благодарам(0)   Цитирај ZokiBoSS Цитирај  Внеси репликаОдговор Директен линк до овој коментар Испратена: 28.Август.2006 во 13:18
Влечка,  браво.. Не ни очекував женско да биде заинтересирано за линукс, и затоа помислив дека е некое машко .. Сепак, сакав и да ти речам да го едитираш постот кога си по слободна, и да ги оставиш само основните или инаку речено најбитните команди, бидејќи факт е дека VI е најдобар едитор, но и најкомплициран..  Поздрав
That What Doesn't Kill Me, Only Makes Me Stronger..!
Кон врв
natalija Кликни и види ги опциите
Сениор
Сениор
Лик (аватар)
Министерка за гушкање

Регистриран: 26.Јули.2005
Статус: Офлајн
Поени: 13319
Опции за коментарот Опции за коментарот   Благодарам (0) Благодарам(0)   Цитирај natalija Цитирај  Внеси репликаОдговор Директен линк до овој коментар Испратена: 28.Август.2006 во 13:31
Зашто бе Зоки и јас сум женско па одлично го познавам линухот и го владеам
Кон врв
Flix Кликни и види ги опциите
Сениор
Сениор
Лик (аватар)
Клабинг

Регистриран: 14.Септември.2005
Статус: Офлајн
Поени: 9229
Опции за коментарот Опции за коментарот   Благодарам (0) Благодарам(0)   Цитирај Flix Цитирај  Внеси репликаОдговор Директен линк до овој коментар Испратена: 28.Август.2006 во 15:37
Навистина е одлично за тоа што се потрудивте. ас сум еден понов корисник на линукс и овие наредби ми помогнаа.

Поздрав 
Кон врв
 Внеси реплика Внеси реплика
  Сподели тема   

Скок до Овластувања Кликни и види ги опциите

Forum Software by Web Wiz Forums® version 10.03
Copyright ©2001-2011 Web Wiz Ltd.

Страницата е генерирана за 0,219 секунди.