Shortcut commands in Linux

 

BASH COMMANDS :




Terminating Processes:


Ctrl + C: This command interrupts and stops the current running process in the terminal. It is useful when you need to stop a command that is taking too long or is not functioning as expected.

Suspending Processes:


Ctrl + Z: This command suspends the current process and puts it in the background. You can later resume it using the fg command to bring it back to the foreground.

Logging Out:


Ctrl + D: This shortcut logs you out from the current terminal session or signals the end of file (EOF) to the running process, often used to log out or end a terminal session.

Cursor Navigation:


Ctrl + A: Moves the cursor to the beginning of the line. This is useful for quickly going to the start of a command line to edit the beginning of the command.

Ctrl + E: Moves the cursor to the end of the line. This helps to quickly navigate to the end of a long command.

Command History Search:


Ctrl + R: Initiates a reverse search through the command history. This allows you to quickly find and reuse previously entered commands by typing part of the command.

Clearing the Screen:


Ctrl + L: Clears the terminal screen. This helps to declutter your terminal view without closing the session.

Text Editing:


Ctrl + U: Cuts (deletes) everything from the cursor position to the beginning of the line.

Ctrl + K: Cuts (deletes) everything from the cursor position to the end of the line.

Ctrl + Y: Pastes the text that was cut using Ctrl + U or Ctrl + K.

Word Deletion and Navigation:


Ctrl + W: Cuts (deletes) the word before the cursor position. This is useful for quickly deleting incorrect words in a command.

Alt + F: Moves the cursor forward one word at a time, allowing for quick navigation through the command line.

Alt + B: Moves the cursor backward one word at a time.

Alt + D: Deletes the word after the cursor, which can be helpful for editing commands efficiently.

These shortcuts enhance productivity and make command-line navigation and editing faster and more efficient.


NANO COMMANDS :





Opening and Closing Files:


nano filename: Opens the file in the Nano text editor.

Ctrl + X: Exits Nano. If there are unsaved changes, Nano will prompt you to save them.

Saving Files:


Ctrl + O: Saves the current file. Nano will prompt you to confirm the filename before saving.

Cutting and Pasting Text:


Ctrl + K: Cuts the entire current line and stores it in a buffer.

Ctrl + U: Pastes the last cut line from the buffer at the cursor position.

Searching Text:


Ctrl + W: Initiates a search prompt. Type the search term and press Enter to find it in the text.

Navigation:


Ctrl + A: Moves the cursor to the beginning of the current line.

Ctrl + E: Moves the cursor to the end of the current line.

Ctrl + Y: Scrolls up one screen.

Ctrl + V: Scrolls down one screen.

Undo and Redo:


Ctrl + _: Undo the last action (on some systems, it may be Alt + U).

Alt + E: Redo the undone action.

Help:


Ctrl + G: Opens the help menu, providing information about all Nano commands.

These commands help you effectively edit text files using the Nano editor.



VI COMMANDS :






Modes:


Command Mode: Default mode for navigating and issuing commands. Press Esc to enter this mode.

Insert Mode: For inserting text. Press i to enter this mode from Command Mode.

Exiting:


: Save the file.

: Quit Vi.

: Save and quit.

!: Quit without saving changes.

Navigation:


h: Move left.

j: Move down.

k: Move up.

l: Move right.

0: Move to the beginning of the line.

*$: Move to the end of the line.

G: Go to the last line of the file.

gg: Go to the first line of the file.

Editing:


i: Enter Insert Mode before the cursor.

a: Enter Insert Mode after the cursor.

x: Delete the character under the cursor.

dd: Delete the current line.

yy: Yank (copy) the current line.

p: Paste the yanked line after the cursor.

Search:


/pattern: Search for "pattern" in the file.

n: Move to the next occurrence of the search pattern.

N: Move to the previous occurrence of the search pattern.

Undo and Redo:


u: Undo the last action.

Ctrl + r: Redo the undone action.

These commands provide basic functionality to efficiently use the Vi editor for text editing.

 

VIM COMMANDS :



Vim is a powerful text editor widely used for programming and text editing.

 It operates in several modes, primarily command mode for issuing commands and insert mode for text entry.

 Users can efficiently navigate, edit, and manipulate text with various shortcuts and commands.

 Vim supports complex search and replace functionalities, undo and redo operations, and customizable key mappings. 

Its extensive plugin system allows for enhanced functionality and customization, making it a favorite among developers and system administrators for its efficiency and versatility.

 Vim's steep learning curve is often offset by the productivity gains it offers once mastered.

Comments

Popular Posts