Skip to content

Instantly share code, notes, and snippets.

@davidhcefx
Last active April 14, 2022 01:10
Show Gist options
  • Save davidhcefx/3e9546e4491de5546569cf0e53d2ccc3 to your computer and use it in GitHub Desktop.
Save davidhcefx/3e9546e4491de5546569cf0e53d2ccc3 to your computer and use it in GitHub Desktop.

Revisions

  1. davidhcefx revised this gist Oct 1, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Disadvantages of Linux.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ## `rsync`
    I was using `rsync -e "ssh"` to transfer files between local and remote computer. If I want to transfer a file from remote to local, the command will be like `rsync -av --delete -e "ssh" user@ip:/path/to/fileA /home/user/folder/`. One day, however, I thought I can transfer a remote folder `/path/to/folderA/` to my home `/home/user/`. After running the command, I found that it is erasing my home directory! Since Linux has disk encryption by default, I failed to rescue those files eventually ;(
    I was using `rsync -e "ssh"` to transfer files between local and remote computer. If I want to transfer a file from remote to local, the command will be like `rsync -av --delete -e "ssh" user@ip:/path/to/fileA /home/user/folder/`. One day, however, I thought I could transfer a remote folder `/path/to/folderA/` to my home `/home/user/`. After running the command, I found that it started erasing my home directory! Since Linux has disk encryption by default, I failed to rescue those files eventually ;(

    ## `bash_history`
    My bash history was stored as `~/.bash_history`. One day, I was running a huge [apt upgrade](https://linux.die.net/man/8/apt-get). It took me plenty of time, so I left it and went to sleep. However, I forgot that my laptop was in *battery mode*. So eventually, the battery ran out, and my computer experienced an abnormal power off, which resulted in me having a corrupted `bash_history`. I have no backups, so I lost all my bash history ;(
    @@ -8,4 +8,4 @@ My bash history was stored as `~/.bash_history`. One day, I was running a huge [
    I just learned how to use `tee` to append contents to a file! Instead of `>>`, I can use `tee`, which is usefull if I want to write to some files owned by `root`. This time, I want to append a `bashrc` taken from another computer to my own computer, in order to do some modifications afterwards. However, I confused `tee -a` with `tee`. Too bad, my local `bashrc` was gone forever ;(

    ## `mv`
    I was moving *fileA* to a folder. I have done this so many times, simply type the folder name, hit `TAB` to auto-complete it, and then hit `Enter`. This time, unfortunately, I typed it wrong, and it auto-completed to another *fileB*. Too bad, I can't recover that file anymore ;(
    I was moving *fileA* to a folder. I have done this so many times: simply type the folder name, hit `TAB` to auto-complete it, and finally hit `Enter`. This time, unfortunately, I typed it wrong, and it auto-completed to another *fileB*. Too bad, I couldn't recover that file anymore ;(
  2. davidhcefx revised this gist Sep 19, 2020. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions Disadvantages of Linux.md
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,11 @@
    ## `mv`
    I was moving *fileA* to a folder. I have done this so many times, simply type the folder name, hit `TAB` to auto-complete it, and then hit `Enter`. This time, unfortunately, I typed it wrong, and it auto-completed to another *fileB*. Too bad, I can't recover that file anymore ;(

    ## `tee`
    I just learned how to use `tee` to append contents to a file! Instead of `>>`, I can use `tee`, which is usefull if I want to write to some files owned by `root`. This time, I want to append a `bashrc` taken from another computer to my own computer, in order to do some modifications afterwards. However, I confused `tee -a` with `tee`. Too bad, my local `bashrc` was gone forever ;(
    ## `rsync`
    I was using `rsync -e "ssh"` to transfer files between local and remote computer. If I want to transfer a file from remote to local, the command will be like `rsync -av --delete -e "ssh" user@ip:/path/to/fileA /home/user/folder/`. One day, however, I thought I can transfer a remote folder `/path/to/folderA/` to my home `/home/user/`. After running the command, I found that it is erasing my home directory! Since Linux has disk encryption by default, I failed to rescue those files eventually ;(

    ## `bash_history`
    My bash history was stored as `~/.bash_history`. One day, I was running a huge [apt upgrade](https://linux.die.net/man/8/apt-get). It took me plenty of time, so I left it and went to sleep. However, I forgot that my laptop was in *battery mode*. So eventually, the battery ran out, and my computer experienced an abnormal power off, which resulted in me having a corrupted `bash_history`. I have no backups, so I lost all my bash history ;(

    ## `rsync`
    I was using `rsync -e "ssh"` to transfer files between local and remote computer. If I want to transfer a file from remote to local, the command will be like `rsync -av --delete -e "ssh" user@ip:/path/to/fileA /home/user/folder/`. One day, however, I thought I can transfer a remote folder `/path/to/folderA/` to my home `/home/user/`. After running the command, I found that it is erasing my home directory! Since Linux has disk encryption by default, I failed to rescue those files eventually ;(
    ## `tee`
    I just learned how to use `tee` to append contents to a file! Instead of `>>`, I can use `tee`, which is usefull if I want to write to some files owned by `root`. This time, I want to append a `bashrc` taken from another computer to my own computer, in order to do some modifications afterwards. However, I confused `tee -a` with `tee`. Too bad, my local `bashrc` was gone forever ;(

    ## `mv`
    I was moving *fileA* to a folder. I have done this so many times, simply type the folder name, hit `TAB` to auto-complete it, and then hit `Enter`. This time, unfortunately, I typed it wrong, and it auto-completed to another *fileB*. Too bad, I can't recover that file anymore ;(
  3. davidhcefx revised this gist Sep 19, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Disadvantages of Linux.md
    Original file line number Diff line number Diff line change
    @@ -7,5 +7,5 @@ I just learned how to use `tee` to append contents to a file! Instead of `>>`, I
    ## `bash_history`
    My bash history was stored as `~/.bash_history`. One day, I was running a huge [apt upgrade](https://linux.die.net/man/8/apt-get). It took me plenty of time, so I left it and went to sleep. However, I forgot that my laptop was in *battery mode*. So eventually, the battery ran out, and my computer experienced an abnormal power off, which resulted in me having a corrupted `bash_history`. I have no backups, so I lost all my bash history ;(

    ## rsync
    ## `rsync`
    I was using `rsync -e "ssh"` to transfer files between local and remote computer. If I want to transfer a file from remote to local, the command will be like `rsync -av --delete -e "ssh" user@ip:/path/to/fileA /home/user/folder/`. One day, however, I thought I can transfer a remote folder `/path/to/folderA/` to my home `/home/user/`. After running the command, I found that it is erasing my home directory! Since Linux has disk encryption by default, I failed to rescue those files eventually ;(
  4. davidhcefx revised this gist Sep 19, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Disadvantages of Linux.md
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,4 @@ I just learned how to use `tee` to append contents to a file! Instead of `>>`, I
    My bash history was stored as `~/.bash_history`. One day, I was running a huge [apt upgrade](https://linux.die.net/man/8/apt-get). It took me plenty of time, so I left it and went to sleep. However, I forgot that my laptop was in *battery mode*. So eventually, the battery ran out, and my computer experienced an abnormal power off, which resulted in me having a corrupted `bash_history`. I have no backups, so I lost all my bash history ;(

    ## rsync
    I was using `rsync -e "ssh"` to transfer files between local and remote computer. If I want to transfer a file from remote to local, the command will be like `rsync -av --delete -e "ssh" user@ip:/path/to/fileA /home/user/folder/`. One day, however, I thought I can transfer a remote folder `/path/to/folderA/` to my home `/home/user/`. After running the command, I found that it is erasing my home directory! Since Linux has disk encryption by default, I could not rescue those files eventually ;(
    I was using `rsync -e "ssh"` to transfer files between local and remote computer. If I want to transfer a file from remote to local, the command will be like `rsync -av --delete -e "ssh" user@ip:/path/to/fileA /home/user/folder/`. One day, however, I thought I can transfer a remote folder `/path/to/folderA/` to my home `/home/user/`. After running the command, I found that it is erasing my home directory! Since Linux has disk encryption by default, I failed to rescue those files eventually ;(
  5. davidhcefx revised this gist Sep 19, 2020. 1 changed file with 7 additions and 4 deletions.
    11 changes: 7 additions & 4 deletions Disadvantages of Linux.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,11 @@
    ## `bash_history`
    My bash history was stored as `~/.bash_history`. One day, I was running a huge [apt upgrade](https://linux.die.net/man/8/apt-get). It took me plenty of time, so I left it and went to sleep. However, I forgot that my laptop was in *battery mode*. So eventually, the battery ran out, and my computer experienced an abnormal power off, which resulted in me having a corrupted `bash_history`. I have no backups, so I lost all my bash history ;(
    ## `mv`
    I was moving *fileA* to a folder. I have done this so many times, simply type the folder name, hit `TAB` to auto-complete it, and then hit `Enter`. This time, unfortunately, I typed it wrong, and it auto-completed to another *fileB*. Too bad, I can't recover that file anymore ;(

    ## `tee`
    I just learned how to use `tee` to append contents to a file! Instead of `>>`, I can use `tee`, which is usefull if I want to write to some files owned by `root`. This time, I want to append a `bashrc` taken from another computer to my own computer, in order to do some modifications afterwards. However, I confused `tee -a` with `tee`. Too bad, my local `bashrc` was gone forever ;(

    ## `mv`
    I was moving *fileA* to a folder. I have done this so many times, simply type the folder name, hit `TAB` to auto-complete it, and then hit `Enter`. This time, unfortunately, I typed it wrong, and it auto-completed to another *fileB*. Too bad, I can't recover that file anymore ;(
    ## `bash_history`
    My bash history was stored as `~/.bash_history`. One day, I was running a huge [apt upgrade](https://linux.die.net/man/8/apt-get). It took me plenty of time, so I left it and went to sleep. However, I forgot that my laptop was in *battery mode*. So eventually, the battery ran out, and my computer experienced an abnormal power off, which resulted in me having a corrupted `bash_history`. I have no backups, so I lost all my bash history ;(

    ## rsync
    I was using `rsync -e "ssh"` to transfer files between local and remote computer. If I want to transfer a file from remote to local, the command will be like `rsync -av --delete -e "ssh" user@ip:/path/to/fileA /home/user/folder/`. One day, however, I thought I can transfer a remote folder `/path/to/folderA/` to my home `/home/user/`. After running the command, I found that it is erasing my home directory! Since Linux has disk encryption by default, I could not rescue those files eventually ;(
  6. davidhcefx revised this gist Sep 19, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Disadvantages of Linux.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ## `bash_history`
    My bash history was stored as `~/.bash_history`. One day, I was running a huge [apt upgrade](https://linux.die.net/man/8/apt-get). It took me plenty of time, so I left it and went to sleep. However, I forgot that the laptop was in *battery mode*. Eventually, the battery ran out, and my computer experienced an abnormal power off, which resulted in me having a corrupted `bash_history`. I have no backups, so I lost all my bash history ;(
    My bash history was stored as `~/.bash_history`. One day, I was running a huge [apt upgrade](https://linux.die.net/man/8/apt-get). It took me plenty of time, so I left it and went to sleep. However, I forgot that my laptop was in *battery mode*. So eventually, the battery ran out, and my computer experienced an abnormal power off, which resulted in me having a corrupted `bash_history`. I have no backups, so I lost all my bash history ;(

    ## `tee`
    I just learned how to use `tee` to append contents to a file! Instead of `>>`, I can use `tee`, which is usefull if I want to write to some files owned by `root`. This time, I want to append a `bashrc` taken from another computer to my own computer, in order to do some modifications afterwards. However, I confused `tee -a` with `tee`. Too bad, my local `bashrc` was gone forever ;(
  7. davidhcefx revised this gist Sep 19, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Disadvantages of Linux.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ## `bash_history`
    My bash history was stored as `~/.bash_history`. One day, I was running a huge apt upgrade. It took me plenty of time, so I left it and went to sleep. However, I forgot that the laptop was in *battery mode*. Eventually, the battery ran out, and my computer experienced an abnormal power off, which resulted in me having a corrupted `bash_history`. I have no backups, so I lost all my bash history ;(
    My bash history was stored as `~/.bash_history`. One day, I was running a huge [apt upgrade](https://linux.die.net/man/8/apt-get). It took me plenty of time, so I left it and went to sleep. However, I forgot that the laptop was in *battery mode*. Eventually, the battery ran out, and my computer experienced an abnormal power off, which resulted in me having a corrupted `bash_history`. I have no backups, so I lost all my bash history ;(

    ## `tee`
    I just learned how to use `tee` to append contents to a file! Instead of `>>`, I can use `tee`, which is usefull if I want to write to some files owned by `root`. This time, I want to append a `bashrc` taken from another computer to my own computer, in order to do some modifications afterwards. However, I confused `tee -a` with `tee`. Too bad, my local `bashrc` was gone forever ;(
  8. davidhcefx revised this gist Sep 19, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions Disadvantages of Linux.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    ## `bash_history`
    My bash history was stored as `~/.bash_history`. One day, I was running a huge apt upgrade. It took me plenty of time, so I left it and went to sleep. However, I forgot that the laptop was in *battery mode*. Eventually, the battery ran out, and my computer experienced an abnormal power off, which resulted in me having a corrupted `bash_history`. I have no backups, so I lost all my bash history ;(

    ## `tee`
    I just learned how to use `tee` to append contents to a file! Instead of `>>`, I can use `tee`, which is usefull if I want to write to some files owned by `root`. This time, I want to append a `bashrc` taken from another computer to my own computer, in order to do some modifications afterwards. However, I confused `tee -a` with `tee`. Too bad, my local `bashrc` was gone forever ;(

  9. davidhcefx revised this gist Sep 19, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Disadvantages of Linux.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ## `tee`
    I just learned how to use `tee` to append contents to a file! Instead of `>>`, I can use `tee`, which is usefull if I want to write to some files owned by `root`. This time, I want to append a `bashrc` taken from another computer to my local computer. However, I confused `tee -a` with `tee`. Too bad, my local `bashrc` was gone forever ;(
    I just learned how to use `tee` to append contents to a file! Instead of `>>`, I can use `tee`, which is usefull if I want to write to some files owned by `root`. This time, I want to append a `bashrc` taken from another computer to my own computer, in order to do some modifications afterwards. However, I confused `tee -a` with `tee`. Too bad, my local `bashrc` was gone forever ;(

    ## `mv`
    I was moving *fileA* to a folder. I have done this so many times, simply type the folder name, hit `TAB` to auto-complete it, and then hit `Enter`. This time, unfortunately, I typed it wrong, and it auto-completed to another *fileB*. Too bad, I can't recover that file anymore ;(
  10. davidhcefx revised this gist Sep 19, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions Disadvantages of Linux.md
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,5 @@
    ## `tee`
    I just learned how to use `tee` to append contents to a file! Instead of `>>`, I can use `tee`, which is usefull if I want to write to some files owned by `root`. This time, I want to append a `bashrc` taken from another computer to my local computer. However, I confused `tee -a` with `tee`. Too bad, my local `bashrc` was gone forever ;(

    ## `mv`
    I was moving *fileA* to a folder. I have done this so many times, simply type the folder name, hit `TAB` to auto-complete it, and then hit `Enter`. This time, unfortunately, I typed it wrong, and it auto-completed to another *fileB*. Too bad, I can't recover that file anymore ;(
  11. davidhcefx revised this gist Sep 19, 2020. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions Disadvantages of Linux.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,2 @@
    ## `mv`
    I was moving *fileA* to a folder. I have done this so many times, simply type the folder name, hit `TAB` to auto-complete it, and then hit `Enter`.
    This time, unfortunately, I typed it wrong, and it auto-completed to another *fileB*. Too bad, I can't recover that file anymore ;(
    I was moving *fileA* to a folder. I have done this so many times, simply type the folder name, hit `TAB` to auto-complete it, and then hit `Enter`. This time, unfortunately, I typed it wrong, and it auto-completed to another *fileB*. Too bad, I can't recover that file anymore ;(
  12. davidhcefx revised this gist Sep 19, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Disadvantages of Linux.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    ## `mv`
    I was moving *fileB* to a folder. I have done this so many times, simply type the folder name, hit `TAB` to auto-complete it, and then hit `Enter`.
    I was moving *fileA* to a folder. I have done this so many times, simply type the folder name, hit `TAB` to auto-complete it, and then hit `Enter`.
    This time, unfortunately, I typed it wrong, and it auto-completed to another *fileB*. Too bad, I can't recover that file anymore ;(
  13. davidhcefx revised this gist Sep 19, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Disadvantages of Linux.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    ## `mv`:
    ## `mv`
    I was moving *fileB* to a folder. I have done this so many times, simply type the folder name, hit `TAB` to auto-complete it, and then hit `Enter`.
    This time, unfortunately, I typed it wrong, and it auto-completed to another *fileB*. Too bad, I can't recover that file anymore ;(
  14. davidhcefx created this gist Sep 19, 2020.
    3 changes: 3 additions & 0 deletions Disadvantages of Linux.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    ## `mv`:
    I was moving *fileB* to a folder. I have done this so many times, simply type the folder name, hit `TAB` to auto-complete it, and then hit `Enter`.
    This time, unfortunately, I typed it wrong, and it auto-completed to another *fileB*. Too bad, I can't recover that file anymore ;(