Skip to content Skip to content


Some useful Linux bash tricks Daži noderīgi Linux bash tricks

Linux

I use the Linux command line extensively, both on my local machine or when I'm connected to a remote server. Es izmantoju Linux komandrindas plaši, gan savas vietējās mašīna vai kad es esmu savienots ar attàlo serveri. There are some keyboard shortcuts that I want to share with you which have made my life on BASH a lot easier. Ir dažas tastatūras īsceļus, ka es vēlos dalīties ar jums, kas ir ar manu dzīves bash daudz vieglāk. I have not come across too many books that have documented these shortcuts and I think they are quite important to improve your productivity while on the command line. Es neesmu sastapties pārāk daudz grāmatu, kas dokumentē šos īsceļus, un es domāju, ka viņi ir diezgan svarīga, lai uzlabotu savu produktivitāti, par komandrindu.

1. 1. Ctrl + r Ctrl + R

This keyboard shortcut is for running a reverse search in your command line. Šis tastatūras īsinājumtaustiņu ir darboties apgrieztas meklēšanas jūsu komandrindu. To use this shortcut hold down the “Control” key in your terminal interface and hit the “r” while the “Control” key is still pressed. Lai izmantotu šīs saīsnes turiet "Kontrole" ievadiet Jūsu termināla saskarne un hit "r", savukārt "Control" taustiņu joprojām ir nospiests. you should get a message like this: Jums vajadzētu saņemt ziņu šādi:

(reverse-i-search)`': (reverse-i-search) "":

Now begin typing a command you used earlier. Tagad sāciet rakstīt komandu, kuru izmantojāt iepriekš. BASH will automatically complete your command. Bash automātiski pabeigt savu komandu. You can keep hitting the “Ctrl + r” combination to search further. Jūs varat saglabāt hitting "Ctrl + r" kombinācijas, lai meklētu tālāk.

2. 2. Ctrl + a Ctrl +

This shortcut makes your cursor jump to the beginning of the line. Šīs saīsnes padara jūsu kursors pāriet uz sākuma līnijas. When you have typed a few works in your terminal hit the key combination of “Control + a” and you will reach the beginning of the line you are typing in. Kad esat ievadījis daži darbojas jūsu gala hit taustiņu kombināciju "Ctrl +", un jūs sasniegsiet sākuma līnijas rakstāt iekšā

3. 3. Ctrl + e Ctrl + E

This shortcut is similar to the previous one, except it makes your cursor jump to the other end of the line, the end. Šīs saīsnes ir līdzīgs iepriekšējā, izņemot to padara jūsu kursors pārlēkt uz otru galu līnijas beigās. Type this key combination when in the middle of a line you are typing and you will jump right to the end of the line. Ierakstiet šo taustiņu kombināciju, kad vidus līniju rakstāt un jūs lēkt tiesības beigām līnijas.

4. 4. Ctrl + w Ctrl + W

Using this shortcut will result in the deletion of one word to the left of the cursor. Izmantojot šo īsceļu rezultātā svītrot vienu vārdu pa kreisi no kursora. So if you are in the middle of a line that you are typing hitting “Control + w” will delete one word before the cursor. Tātad, ja jūs esat vidū līniju, jūs rakstāt hitting "Control + w" tiks dzēst vienu vārdu pirms kursora.

5. 5. ESC + d ESC + d

This shortcut is the opposite of the previous one. Šīs saīsnes ir pretējs iepriekšējo. Hitting “Escape + d” in your terminal will delete one word to the right of the cursor. Hitting "Escape + d" in your termināls izdzēsīs vienu vārdu pa labi no kursora.

6. 6. Ctrl + k Ctrl + K

This is a very powerful shortcut and must be used with caution. Tas ir ļoti spēcīgs shortcut un tas ir jālieto piesardzīgi. It deletes all the data to the right of the cursor in the line that you are typing in. Tā dzēš visus datus tiesības kursoru līniju, ka jūs rakstāt iekšā

7. 7. Ctrl + u Ctrl + U

This is again a very powerful shortcut and must be used with caution. Tas ir atkal ļoti spēcīgs shortcut un tas ir jālieto piesardzīgi. It deletes all the data to the left of the cursor in the line that you are typing in. Remember that once you run this shortcut you can not get back the text that you have typed. Tā dzēš visus datus pa kreisi no kursora rindā, ka jūs rakstāt iekšā Atcerieties, ka tad, kad jūs darbināt šīs saīsnes jūs nevarat atgriezties tekstu, kuru jūs ierakstījāt.

Posted in Iesūtīts Linux Linux . .

Related Posts: Related Posts:

How to get a list of files an RPM package depends on Kā nokļūt failu saraksts RPM paketi ir atkarīga no
Bash one liner – how to compress, move, and extract a directory Bash vienu starpliku - kā, lai saspiestu, pārvieto un ekstrakts katalogs
How to monitor your Linux machine with netstat Kā kontrolēt savu Linux mašīna ar netstat
The Linux 'date' command Linux "diena" komanda
How to send email from the Linux command line Kā sūtīt e-pastu no Linux komandrindas

5 Responses 5 Atbildes

Stay in touch with the conversation, subscribe to the Uzturēt kontaktus ar sarunu, abonēt RSS feed for comments on this post RSS barību komentārus par šo ziņu . .

  1. gyffes says gyffes saka

    Always appreciate the extra knowledge! Vienmēr novērtēt papildu zināšanas! Thanks for sharing! Thanks for sharing!

  2. Ben says Ben saka

    > Remember that once you run this shortcut you can not get back > Atcerieties, ka vienreiz palaist šīs saīsnes jūs nevarat atgriezties
    > the text that you have typed. > Teksts, kas jums ir drukāti.

    Not true. Nav taisnība. All the shortcuts you mentioned that remove anything from the command line will place a copy in the kill buffer. Visas saīsnes Jūs minējāt, ka izņemt kaut ko no komandrindas uzliks kopiju nogalināt buferšķīdumā. You can yank it from the buffer using CTRL-y Jūs varat paraut no bufera, izmantojot CTRL-y

  3. p4bl0 p4bl0 says saka

    Ya Ben is right. Ya Ben ir taisnība. In fact every Emacs users are comfortable with these defaults bash keybindings cause they are often the same as Emacs. Patiesībā ik Emacs lietotāji ir apmierināti ar šo saistību nepildīšanu bash keybindings izraisīt tās bieži vien ir tādi paši kā Emacs.
    I can't understand who could prefer that ^^, but there's also a vi-mode for bash (for readline) : “set -o vi” (”set -o emacs” to get back in the good way :-p). Es nevaru saprast, kas varētu dod priekšroku šim ^ ^, bet tur ir arī vi-režīmu bash (par readline): "set-o vi" ( "set-o konsole nav terminālis", lai saņemtu atpakaļ labs veids,:-p) .

  4. db1911 says db1911 saka

    As a noob, I appreciate the info Kā noob, I appreciate info

Continuing the Discussion Turpinot iztirzājumu

  1. Lucas Arregui » Blog Archive » Linux command line shortcuts Lucas Arregui »Blog Archive» Linux komandrindas īsceļi linked to this post on February 15, 2009 saistīts ar šo ziņu par 2009 Februāris 15,

    [...] The following tips were posted by Sukrit Dhandhaniaon his post “Some useful Linux bash tricks” and you can see it here [...] [...] Šie padomi ir ievietojis Sukrit Dhandhaniaon amata "Daži noderīgi Linux bash trikus", un jūs varat redzēt šeit [...]



Some HTML is OK Daži HTML ir OK

or, reply to this post via vai, atbildot uz šo ziņu izmantojot trackback Trackback . .