From 77030c1cf6ff0f63eb1540af009076439f9d4a71 Mon Sep 17 00:00:00 2001 From: proledatarian Date: Sat, 5 Feb 2022 14:12:25 +0000 Subject: [PATCH] Added another tip and TOC. --- README.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9280b75..c56c350 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,21 @@ # Random Linux Tips (WIP) - + ### 0. *Short example template.* - Description: *What is this good for.* - Requires: *Do you need any particular software (provide a link)?* - How-to: *Straight forward description and maybe a code example.* - *Detailled description if necessary.* - $ sudo this is the actual code lol -- Aditionally: *Anything else that might be important.* - + - $ sudo this is the actual code lol +- Aditionally: *Anything else that might be important like additional ressources.* + +[[_TOC_]] + ### 1. Automatically clear cache. - Description: Move files older than a specific amount of time from your user's ~/.cache directory to the trash. - Requires: [https://github.com/PhrozenByte/rmtrash](rmtrash). - How-to: - Add the following line to your crontab using the command "crontab -e" (or EDITOR=$editor crontab -e): - $ 0 17 * * * /usr/bin/find ~/.cache/* -mtime +7 -exec /usr/bin/rmtrash -rf {} \; + - $ 0 17 * * * /usr/bin/find ~/.cache/* -mtime +7 -exec /usr/bin/rmtrash -rf {} \; - This command looks at files in ~/.cache every day at 5 p.m. and moves files older than 7 days to the trash. - Additionally: This can also be done using regular "rm" instead of "rmtrash". @@ -28,3 +30,10 @@ https://wiki.archlinux.org/title/Nano#Syntax_highlighting ### 5. Use sudo !!. +### 6. Prevent overwriting files. +- Description: Use alias for *rm*, *cp* and *mv*. +- How-to: Add the following alias into your ~/.bashrc. + - Use *-interactive* option to get asked before overwriting files. + - $ alias mv="mv -i" +- Additionally: Further reading in the Arch wiki. +