Useful bash commands

From rbachwiki
Revision as of 19:01, 29 May 2022 by Bacchas (talk | contribs) (Created page with "==Go back to the previous directory== cd - ==Clear Screen == ctrl + L == Background Taks== ctrl + z // send to background fg // bring back == if you type a command and forget to 'sudo' == sudo !! // this will add sudo to the previous failed command ==Search through your previous commands == ctrl + R // then type part of the command you remember history // will list previously run command ''' Rerun command from history ''' !100 // this is the number form th...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Go back to the previous directory

cd -

Clear Screen

ctrl + L

Background Taks

ctrl + z // send to background
fg // bring back 

if you type a command and forget to 'sudo'

sudo !! // this will add sudo to the previous failed command

Search through your previous commands

ctrl + R // then type part of the command you remember
history // will list previously run command

Rerun command from history

!100 // this is the number form the history list
ctrl + u // delete everyting on the prompt
ctrl + a // brings you to the front of the line
ctrl + e // end of the line

Run two commands, one after the other

command1; command2 // use semi;

Display output in columns

// pipe output into column command
mount | column -t