Bash Commands

Bash Commands
Bash Commands

readline shortcuts / bash commands:

Esc = ALT
(esc + b = alt +b) (in case you can't use alt / mod1)

set -o vi
put readline in vi mode

set -o emacs
put readline in emacs/default mode

Autocompletes from the cursor position.

delete one word back non-alphanumerically delimited

(that's a pipe) sends SIGQUIT.

undo typing

Insert last argument

insert the final argument to the last command at the cursor point

cursor to beginning of line (home-key)

move back one character.

cursor one word back

Sending signal SIGINT the current process you run (usually the process will be killed)

capitalizes the character under the cursor and moves to the end of the word.

delete char under cursor. If blank line send EOF, Exit/logout shell.

cut one word after the cursor

cuts the word before the cursor

cursor to end of line (end-key)

move forward one character.

cursor one word forward

cancel history search

clear one character before the cursor. (backspace)

select command from history search ^r ^s

cut all characters after the cursor.

cLear screen

Lowercases one word in front of the cursor

scroll next command (downArrow-key)

executes the found command from ^r or ^s

scroll up previous commands (upArrow-key).

recall history from previously used commands. (each ^r  next corresponding command)

cancels changes and put back the line as it was (revert)

back to the next recent command of the search
(careful no to execute it from a terminal because this command also launches its XOFF).
If you changed that XOFF setting, use Ctrl+q to return.

swap the last two characters before the cursor.

swap the last two words before the cursor

cut all characters before the cursor.

uppercase one word after the cursor

^v tab/enter (or any char)
insert a tab, or ^M ,etc

cut one word before the cursor

^x ^e
edits the current line in the $EDITOR program, or vi

^x ^x
jump cursor to last position

paste the last cut characters by CTRL+u or CTRL+k or ALT+d (yank clipboard to cursor)

insert first argument of previous command, (ALT + 2-9, CNTRL + ALT +y : insert nth argument)

put current process into background process with signal SIGTSTP.
To restore it, use command fg [process name or job id]


PROMPT_COMMAND='history -a && history -n'
collects history from current open terminals 

cp ./test.txt{,.bak}
copies test.txt to test.txt.bak 

echo $
echos last arguemnet passed to console 

add() (IFS=+; echo $(($*))
add 2 4 2 
creates a function called add
adds 2 4 2 together
Next Post »


Click here for comments
14 February 2022 at 03:16 ×

Great bllog you have

Congrats bro Andrea Becket you got PERTAMAX...! hehehehe...