Posts about bash
Linux diplay size of each subdirectory
running-scripts-in-background-linux
I used to execute a lot of commands with & at the end. But once I used plowshare and it didnt work because & works until you wont log out .So my solution (I know I could use nohup :) ) was screen. Screen is the best tool admin can use when working remotely. It can be usefull when you're in place with big packet loss and you often lost connection so when you're restoring database you should be in screen session because when something will disconnect you you can alwas log in and connect to screen session in which restoring is taking place.
So executing
will be only running when your session is still active so when you'll logout it will be killed.
To run it independent from your presence on server do it with nohup:
To launch screen :
Best practice is to launch screen with its name :
Then if you want detach screen to get back later Ctrlad If you want terminate screen just Ctrld or exitthen you can resume it with:
To list all available screens :
To attach to already attached screen:
To attach to attached screen and detach others:
To rename existing screen:
(being attached): Ctrla:sessionname my_screen_nameEntershell_productivity
Bash / ZSH Terminal productivity
:w
ctrlu clear whole linectrlk clear everything after curson
ctrlw clear everything before curson
ctrla set cursor at the beginning (home)
ctrle set cursor at the end (end)
ctrly undo last clear or repeat after second hit
ctrll clears screen
ctrlr search in you history commands type twice to select next candidate
ESCt Swap the last two words before the cursor
Altf Move cursor every word forward
Altb Move cursoor every word backward
ctrl_ Undo the last change