Some useful Linux bash tricks Деякі корисні Bash Linux трюки

by Sukrit Dhandhania on January 20, 2009 За Sukrit Dhandhania по 20 січня 2009

Linux

I use the Linux command line extensively, both on my local machine or when I'm connected to a remote server. Я використовую Linux рядку команду широко, як на моїй локальній машині або коли я підключений до віддаленого серверу. There are some keyboard shortcuts that I want to share with you which have made my life on BASH a lot easier. Є кілька сполучень клавіш, які я хочу поділитися з вами, які зробили моє життя на BASH набагато простіше. 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. Я не зустрічав дуже багато книг, які документально ці ярлики, і я думаю, що вони мають дуже важливе значення для поліпшення продуктивності в той час як в командному рядку.

1. 1. Ctrl + r Ctrl + R

This keyboard shortcut is for running a reverse search in your command line. Ця клавіатура ярлик для запуску зворотного пошуку в командному рядку. To use this shortcut hold down the “Control” key in your terminal interface and hit the “r” while the “Control” key is still pressed. Для використання цього ярлика потримайте клавішу "Control" в інтерфейс терміналу і натисніть "R", а "ключ управління" все ще натиснута. you should get a message like this: Ви повинні отримати повідомлення так:

(reverse-i-search)`': (зворотний-I-пошук) ` ':

Now begin typing a command you used earlier. Тепер Ви почати набирати команду використовували раніше. BASH will automatically complete your command. BASH автоматично заповнить вашу команду. You can keep hitting the “Ctrl + r” combination to search further. Ви можете залишити попадання "Ctrl + R" Комбінація шукати далі.

2. 2. Ctrl + a CTRL + A

This shortcut makes your cursor jump to the beginning of the line. Цей ярлик робить курсор Перейти до початку рядка. 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. Якщо ви набрали багато робіт в термінал натиснете кнопку комбінацію "Ctrl + A" і ви дійдете до початку рядки ви вводите дюйма

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. Цей ярлик схожий на попередній, за винятком того, робить ваш курсор перейти на інший кінець лінії, кінець. 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. Типи цю комбінацію клавіш, коли в середині рядка ви вводите, і вам буде стрибати до самого кінця лінії.

4. 4. Ctrl + w Ctrl + W

Using this shortcut will result in the deletion of one word to the left of the cursor. За допомогою цього ярлика призведе до видалення одного слова ліворуч від курсору. So if you are in the middle of a line that you are typing hitting “Control + w” will delete one word before the cursor. Так що якщо ви перебуваєте в середині рядка, що ви набираєте натискання на клавішу "Ctrl + W" буде видалити одне слово перед курсором.

5. 5. ESC + d ESC + D

This shortcut is the opposite of the previous one. Цей ярлик протилежне попередньому. Hitting “Escape + d” in your terminal will delete one word to the right of the cursor. Натискання на клавішу "Escape + D" в терміналі буде видалення одного слова праворуч від курсору.

6. 6. Ctrl + k Ctrl + K

This is a very powerful shortcut and must be used with caution. Це дуже потужний ярлика і повинні використовуватися з обережністю. It deletes all the data to the right of the cursor in the line that you are typing in. Вона видаляє всі дані на правому курсор в рядок, у якій ви набираєте дюйма

7. 7. Ctrl + u CTRL + U

This is again a very powerful shortcut and must be used with caution. Це теж дуже потужні ярлика і повинні використовуватися з обережністю. 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. Він видаляє всі дані, ліворуч від курсору в рядку, ви набираєте дюйма Пам'ятайте, що як тільки ви запустіть цю команду, яку ви не можете повернути текст, який ви ввели.

Related Posts: Схожі повідомлення:
  • How to get a list of files an RPM package depends on Як отримати список файлів пакета RPM залежить від
  • Bash one liner – how to compress, move, and extract a directory Баш Один балон - як стиснути, переміщати і екстракт каталозі
  • How to monitor your Linux machine with netstat Як контролювати вашу машину з Linux Netstat
  • The Linux 'date' command Дата Linux 'команди'
  • How to send email from the Linux command line Як відправити електронний з командного рядка Linux
  • Get Simple Help tutorials just like this one in your email inbox every day - for free! Отримати довідки Прості підручників, як це у вашому поштовому ящику щодня - безкоштовно! Just enter your email address below: Просто введіть свою адресу електронної пошти нижче:

    You can always opt out of this email subscription at any time. Ви завжди можете відмовитися від підписки це повідомлення в будь-який час.

    { 1 trackback } (1) Архів

    Lucas Arregui » Blog Archive » Linux command line shortcuts Лукас Arregui »Blog Archive» Linux ярликів командного рядка
    02.15.09 at 11:27 am 02.15.09 в 11:27 ранку

    { 4 comments… read them below or (4 комментария ... читати їх нижче або add one Додати одну } )

    1 1 gyffes 01.20.09 at 11:15 am Gyffes 01.20.09 в 11:15 ранку

    Always appreciate the extra knowledge! Завжди ціную додаткових знань! Thanks for sharing! Дякуємо за обмін!

    2 2 Ben 01.24.09 at 7:01 pm Бена 01.24.09 в 7:01 вечора

    > Remember that once you run this shortcut you can not get back > Пам'ятайте, що як тільки ви запустіть цю команду, яку ви не можете отримати назад
    > the text that you have typed. > Текст, який ви ввели.

    Not true. Неправда. All the shortcuts you mentioned that remove anything from the command line will place a copy in the kill buffer. Всі ярлики ви згадали, що видалити що-небудь з командного рядка буде приділяти скопіювати в буфер. You can yank it from the buffer using CTRL-y Ви можете відновити її з буфера за допомогою Ctrl-Y

    3 3 p4bl0 p4bl0 01.24.09 at 9:42 pm 01.24.09 в 9:42 вечора

    Ya Ben is right. Я. Бен права. In fact every Emacs users are comfortable with these defaults bash keybindings cause they are often the same as Emacs. Фактично кожен Emacs користувачам зручний ці комбінації клавіш за замовчуванням Bash причини вони часто так само, як 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). Я не можу зрозуміти, які могли б вважав за краще, щоб ^ ^, але є також і VI-режим для Bash (для Readline): "Set-O VI" ( "Set-O Emacs", щоб повернутися на краще:-P) .

    4 4 db1911 02.03.09 at 7:03 am db1911 02.03.09 в 7:03 ранку

    As a noob, I appreciate the info Як Noob, я ціную інформація

    Leave a Comment Залишити коментар

    You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Ви можете використовувати ці HTML теги і атрибути: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q Cite=""> <strike> <strong>