# [[Linux]] ![[Linux.svg]] %% Last Updated: - [[2021-03-18]] %% %% date:: [[2020-12-20]], [[2020-12-08]], [[2022-12-23]], [[2022-12-30]] %% # [[Linux]] - [[Getting Disk Metrics on Linux]] - [[Renaming a file on Linux]] - [[Creating a symbolic link to a file on Linux]] - [[Enabling root access to Linux VM]] - [[Connect to Linux VMs as root]] ## Commands ### Delete directory ```bash rm -rf foldername ``` If you get a message that the directory can't be deleted because it's not empty, try: ```bash sudo rm -rf foldername ``` ### [[Reboot Linux VM]] ### Leave a process running after you disconnect To leave a process running even after you've ended the SSH session, you can use `screen`. Screen is a utility that saves a "screen" or session so that you can have multiple of them running even after you disconnect the main session. [^howtogeek] To use it: ```shell screen ``` You'll see a message about hitting SPACE or ENTER, and when you do, you'll see what looks liek the same old command line. Don't be fooled-- you're actually in the screen. Now, run the long-running process or command that you'd like to be executed on the screen. What you do here will not be terminated when you end the SSH session. When you're ready to go back to the "real" command line (it can get a bit inception-y here), hit `CTRL+A` and then `d`. This "detaches" the screen and you should be back at the real command line. To check that the screen is still running: ```shell screen -ls ``` And you should get a response like: ```shell root@ubuntu-s-1vcpu-1gb-fra1-01:~/etherpad-lite# screen -ls There is a screen on: 1463.pts-0.ubuntu-s-1vcpu-1gb-fra1-01 (12/30/22 14:55:48) (Detached) 1 Socket in /run/screen/S-root. root@ubuntu-s-1vcpu-1gb-fra1-01:~/etherpad-lite# ``` To resume a session: ```shell screen -r 1463 ``` where `1463` is the id of the screen, which you got form the previous command. [^howtogeek]: How-to Geek. (2020). *How to use Linux's screen command*. Retrieved from: https://www.howtogeek.com/662422/how-to-use-linuxs-screen-command/ %% # Excalidraw Data ## Text Elements ## Drawing ```json { "type": "excalidraw", "version": 2, "source": "https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/2.1.4", "elements": [ { "id": "4y8R7iOA", "type": "text", "x": 118.49495565891266, "y": -333.44393157958984, "width": 3.8599853515625, "height": 24, "angle": 0, "strokeColor": "#1e1e1e", "backgroundColor": "transparent", "fillStyle": "solid", "strokeWidth": 2, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "frameId": null, "roundness": null, "seed": 967149026, "version": 2, "versionNonce": 939059582, "isDeleted": true, "boundElements": null, "updated": 1713723615080, "link": null, "locked": false, "text": "", "rawText": "", "fontSize": 20, "fontFamily": 4, "textAlign": "left", "verticalAlign": "top", "containerId": null, "originalText": "", "lineHeight": 1.2 } ], "appState": { "theme": "dark", "viewBackgroundColor": "#ffffff", "currentItemStrokeColor": "#1e1e1e", "currentItemBackgroundColor": "transparent", "currentItemFillStyle": "solid", "currentItemStrokeWidth": 2, "currentItemStrokeStyle": "solid", "currentItemRoughness": 1, "currentItemOpacity": 100, "currentItemFontFamily": 4, "currentItemFontSize": 20, "currentItemTextAlign": "left", "currentItemStartArrowhead": null, "currentItemEndArrowhead": "arrow", "scrollX": 583.2388916015625, "scrollY": 573.6323852539062, "zoom": { "value": 1 }, "currentItemRoundness": "round", "gridSize": null, "gridColor": { "Bold": "#C9C9C9FF", "Regular": "#EDEDEDFF" }, "currentStrokeOptions": null, "previousGridSize": null, "frameRendering": { "enabled": true, "clip": true, "name": true, "outline": true } }, "files": {} } ``` %%