How to filter files when using scp to copy dir recursively?

I’d probably recommend using something like rsync for this due to its include and exclude flags, e.g:- rsync -rav -e ssh –include ‘*/’ –include=”*.class” –exclude=”*” \ server:/usr/some/unknown/number/of/sub/folders/ \ /usr/project/backup/some/unknown/number/of/sub/folders/ Some other useful flags: -r for recursive -a for archive (mostly all files) -v for verbose output -e to specify ssh instead of the default (which … Read more

Batch files: How to read a file?

Under NT-style cmd.exe, you can loop through the lines of a text file with FOR /F %%i IN (file.txt) DO @echo %%i Type “help for” on the command prompt for more information. (don’t know if that works in whatever “DOS” you are using)

How to find the largest file in a directory and its subdirectories?

Quote from this link- If you want to find and print the top 10 largest files names (not directories) in a particular directory and its sub directories $ find . -type f -printf ‘%s %p\n’|sort -nr|head To restrict the search to the present directory use “-maxdepth 1” with find. $ find . -maxdepth 1 -printf … Read more

Write variable to a file in Ansible

An important comment from tmoschou: As of Ansible 2.10, The documentation for ansible.builtin.copy says: If you need variable interpolation in copied files, use the ansible.builtin.template module. Using a variable in the content field will result in unpredictable output. For more details see this and an explanation Original answer: You could use the copy module, with … Read more

Where are the recorded macros stored in Notepad++?

In Windows the macros are saved at %AppData%\Notepad++\shortcuts.xml (Windows logo key + E and copy&paste %AppData%\Notepad++\) Or: In Windows < 7 (including Win2008/R2) the macros are saved at C:\Documents and Settings\%username%\Application Data\Notepad++\shortcuts.xml In Windows 7|8|10 C:\Users\%username%\AppData\Roaming\Notepad++\shortcuts.xml Note: You will need to close Notepad++ if you have any new macros you want to ‘export’. Here is … Read more

How can I see local history changes in Visual Studio Code?

Visual Studio Code now offers this in the Timeline view. See Mark’s answer. Or alternatively, if you want a plugin to give you similar functionality, for example: Checkpoints Or the more famous: Local History Some details may need to be configured because the Visual Studio Code search gets confused sometimes because of additional folders created … Read more

How link to any local file with markdown syntax?

None of the answers worked for me. But inspired in BarryPye’s answer I found out it works when using relative paths! # Contents from the ‘/media/user/README_1.md’ markdown file: Read more [here](./README_2.md) # It works! Read more [here](file:///media/user/README_2.md) # Doesn’t work Read more [here](/media/user/README_2.md) # Doesn’t work