<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Linux Lite Forums - Scripting and Bash]]></title>
		<link>https://www.linuxliteos.com/forums/</link>
		<description><![CDATA[Linux Lite Forums - https://www.linuxliteos.com/forums]]></description>
		<pubDate>Mon, 06 Apr 2026 10:05:55 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[code blocks not compiling empty c file]]></title>
			<link>https://www.linuxliteos.com/forums/showthread.php?tid=7760</link>
			<pubDate>Sat, 01 May 2021 14:40:42 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.linuxliteos.com/forums/member.php?action=profile&uid=4581">balasahu</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.linuxliteos.com/forums/showthread.php?tid=7760</guid>
			<description><![CDATA[I am using linux Lite. I have installed code Blocks. When i am creating any new project then it is working correctly. it compiling codes. But When any empty c file is creating and trying to compile then it is not working.<br />
<br />
Showing message that permission denied. I have checked the compiler setting for empty file. it is GNU GCC Compiler. How can I solve this?]]></description>
			<content:encoded><![CDATA[I am using linux Lite. I have installed code Blocks. When i am creating any new project then it is working correctly. it compiling codes. But When any empty c file is creating and trying to compile then it is not working.<br />
<br />
Showing message that permission denied. I have checked the compiler setting for empty file. it is GNU GCC Compiler. How can I solve this?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Hardened-ish potentially portable Waterfox using bash script]]></title>
			<link>https://www.linuxliteos.com/forums/showthread.php?tid=7723</link>
			<pubDate>Tue, 06 Apr 2021 05:17:30 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.linuxliteos.com/forums/member.php?action=profile&uid=4534">MCReaves</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.linuxliteos.com/forums/showthread.php?tid=7723</guid>
			<description><![CDATA[So, not too long ago I got bored and curious and made a rough bash script to fetch uBlock Origin and HTTPS Everywhere addons as well as fetch Waterfox, extract it, set up a basic profile, and create a user.js file and launch script to put the profile in a directory inside the main Waterfox directory.<br />
<br />
The script: <a href="https://pastebin.com/raw/CmewtJ8W" target="_blank" rel="noopener" class="mycode_url">https://pastebin.com/raw/CmewtJ8W</a><br />
Waterfox: <a href="https://www.waterfox.net/about/" target="_blank" rel="noopener" class="mycode_url">https://www.waterfox.net/about/</a><br />
uBlock Origin: <a href="https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/" target="_blank" rel="noopener" class="mycode_url">https://addons.mozilla.org/en-US/firefox...ck-origin/</a><br />
HTTPS Everywhere: <a href="https://addons.mozilla.org/en-US/firefox/addon/https-everywhere/" target="_blank" rel="noopener" class="mycode_url">https://addons.mozilla.org/en-US/firefox...verywhere/</a><br />
<br />
Enjoy, and feel free to make any suggestions. This bash script is considered rough so would probably be considered somewhere between an Alpha and Beta. Also feel free to tweak the script and/or the user.js portion of the script to better match what you need.]]></description>
			<content:encoded><![CDATA[So, not too long ago I got bored and curious and made a rough bash script to fetch uBlock Origin and HTTPS Everywhere addons as well as fetch Waterfox, extract it, set up a basic profile, and create a user.js file and launch script to put the profile in a directory inside the main Waterfox directory.<br />
<br />
The script: <a href="https://pastebin.com/raw/CmewtJ8W" target="_blank" rel="noopener" class="mycode_url">https://pastebin.com/raw/CmewtJ8W</a><br />
Waterfox: <a href="https://www.waterfox.net/about/" target="_blank" rel="noopener" class="mycode_url">https://www.waterfox.net/about/</a><br />
uBlock Origin: <a href="https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/" target="_blank" rel="noopener" class="mycode_url">https://addons.mozilla.org/en-US/firefox...ck-origin/</a><br />
HTTPS Everywhere: <a href="https://addons.mozilla.org/en-US/firefox/addon/https-everywhere/" target="_blank" rel="noopener" class="mycode_url">https://addons.mozilla.org/en-US/firefox...verywhere/</a><br />
<br />
Enjoy, and feel free to make any suggestions. This bash script is considered rough so would probably be considered somewhere between an Alpha and Beta. Also feel free to tweak the script and/or the user.js portion of the script to better match what you need.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[SOLVED] Scripting installation from Lite Software and desktop panel settings]]></title>
			<link>https://www.linuxliteos.com/forums/showthread.php?tid=7658</link>
			<pubDate>Sun, 28 Feb 2021 02:54:23 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.linuxliteos.com/forums/member.php?action=profile&uid=4457">koli</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.linuxliteos.com/forums/showthread.php?tid=7658</guid>
			<description><![CDATA[Hi everyone! Hope you are all having a nice day  <img src="https://www.linuxliteos.com/forums/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" /><br />
<br />
I quite often reinstall my OS or install it on some older machines, so I thought it would be cool to automatize a lot of post installation stuff in a bash script(e.g. installing programs, customizing desktop). I'm relatively new to Linux, so it may be a stupid question, but there are 2 problems I don't know how to solve:<br />
<br />
I found that installing software from Lite Software is easier and more convenient than downloading .deb files or adding repos manually. Can I somehow install software from Lite Software using only the terminal?<br />
<br />
I usually customize the desktop panel, but I didn't found any resource about how to do that in terminal (e.g. setting panel size, font, adding new element, etc.).<br />
<br />
Thank you for your replies in advance!]]></description>
			<content:encoded><![CDATA[Hi everyone! Hope you are all having a nice day  <img src="https://www.linuxliteos.com/forums/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" /><br />
<br />
I quite often reinstall my OS or install it on some older machines, so I thought it would be cool to automatize a lot of post installation stuff in a bash script(e.g. installing programs, customizing desktop). I'm relatively new to Linux, so it may be a stupid question, but there are 2 problems I don't know how to solve:<br />
<br />
I found that installing software from Lite Software is easier and more convenient than downloading .deb files or adding repos manually. Can I somehow install software from Lite Software using only the terminal?<br />
<br />
I usually customize the desktop panel, but I didn't found any resource about how to do that in terminal (e.g. setting panel size, font, adding new element, etc.).<br />
<br />
Thank you for your replies in advance!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[SOLVED - XFCE Terminal Question]]></title>
			<link>https://www.linuxliteos.com/forums/showthread.php?tid=7590</link>
			<pubDate>Sun, 24 Jan 2021 20:33:11 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.linuxliteos.com/forums/member.php?action=profile&uid=4395">benslinux</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.linuxliteos.com/forums/showthread.php?tid=7590</guid>
			<description><![CDATA[Linux user for 9 years, new to Linux Lite and to this forum. What a fantastic distro - coming from Mint Cinnamon desktop to XFCE is a minor adjustment, but I like XFCE - especially the fact that I'm using less resources to run my desktop. <br />
<br />
My question is about the XFCE terminal - after I type a command, I'll often get a result in the next like that shows a colored box with a number in it. I'm guessing that these are error codes of some kind - is there some reference list that explains these numbers - ie - should I use these numbers or interpret them in some way? <br />
<br />
I don't know how to delete my post after having found the answer - the numbers are indeed error codes. By installing 'moreutils' I got a list that can be called up with 'errno' (error numbers). Sorry to post and answer my own question!<br />
<br />
<br />
]]></description>
			<content:encoded><![CDATA[Linux user for 9 years, new to Linux Lite and to this forum. What a fantastic distro - coming from Mint Cinnamon desktop to XFCE is a minor adjustment, but I like XFCE - especially the fact that I'm using less resources to run my desktop. <br />
<br />
My question is about the XFCE terminal - after I type a command, I'll often get a result in the next like that shows a colored box with a number in it. I'm guessing that these are error codes of some kind - is there some reference list that explains these numbers - ie - should I use these numbers or interpret them in some way? <br />
<br />
I don't know how to delete my post after having found the answer - the numbers are indeed error codes. By installing 'moreutils' I got a list that can be called up with 'errno' (error numbers). Sorry to post and answer my own question!<br />
<br />
<br />
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Bash_Functions]]></title>
			<link>https://www.linuxliteos.com/forums/showthread.php?tid=7359</link>
			<pubDate>Tue, 15 Sep 2020 04:03:11 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.linuxliteos.com/forums/member.php?action=profile&uid=4103">Marmaduke</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.linuxliteos.com/forums/showthread.php?tid=7359</guid>
			<description><![CDATA[I'm experimenting with using functions to call a shell script instead of writing the functions out in .bash_functions file.<br />
<br />
<ol type="1" class="mycode_list"><li>Allows me to use VSCode with Synthax highlighting.<br />
</li>
<li>Easy updates of the function without the need to source the functions file.<br />
</li>
<li>I've created a script to prepopulate the functions file and source on each new addition.<br />
</li>
</ol>
]]></description>
			<content:encoded><![CDATA[I'm experimenting with using functions to call a shell script instead of writing the functions out in .bash_functions file.<br />
<br />
<ol type="1" class="mycode_list"><li>Allows me to use VSCode with Synthax highlighting.<br />
</li>
<li>Easy updates of the function without the need to source the functions file.<br />
</li>
<li>I've created a script to prepopulate the functions file and source on each new addition.<br />
</li>
</ol>
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Project Creation]]></title>
			<link>https://www.linuxliteos.com/forums/showthread.php?tid=7358</link>
			<pubDate>Mon, 14 Sep 2020 21:23:33 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.linuxliteos.com/forums/member.php?action=profile&uid=4103">Marmaduke</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.linuxliteos.com/forums/showthread.php?tid=7358</guid>
			<description><![CDATA[I've been working on a script that automates the creation of a new project for me.<br />
<br />
Creates a directory in my Projects directory.<br />
Depending on type of project:<br />
<ol type="1" class="mycode_list"><li>1. Flutter<br />
</li>
<li>2. PHP<br />
</li>
</ol>
etc<br />
<br />
Create the necessary dependices and launches the in VSCode.<br />
<br />
It's a bit too length to share here but I'm in the process of putting it up on GitHub.]]></description>
			<content:encoded><![CDATA[I've been working on a script that automates the creation of a new project for me.<br />
<br />
Creates a directory in my Projects directory.<br />
Depending on type of project:<br />
<ol type="1" class="mycode_list"><li>1. Flutter<br />
</li>
<li>2. PHP<br />
</li>
</ol>
etc<br />
<br />
Create the necessary dependices and launches the in VSCode.<br />
<br />
It's a bit too length to share here but I'm in the process of putting it up on GitHub.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Custom Command Line Recycle Bin]]></title>
			<link>https://www.linuxliteos.com/forums/showthread.php?tid=6475</link>
			<pubDate>Tue, 01 Oct 2019 08:47:33 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.linuxliteos.com/forums/member.php?action=profile&uid=2651">jack action</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.linuxliteos.com/forums/showthread.php?tid=6475</guid>
			<description><![CDATA[I've made a script to put a file or folder into a recycle bin instead of a deleting it with <span style="font-style: italic;" class="mycode_i">rm</span> (which could be problematic if you make an error).<br />
<br />
In a file called <span style="font-style: italic;" class="mycode_i">usr/bin/trash</span>, I've put the following:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#!/bin/bash<br />
<br />
# move a file or folder to a __trash__ folder (within the same directory)<br />
<br />
if [ "&#36;1" = "" ]; then<br />
&nbsp;&nbsp;&nbsp;&nbsp;echo "You need a file or folder name.";<br />
&nbsp;&nbsp;&nbsp;&nbsp;exit 1;<br />
elif [ "&#36;1" = "/" ]; then<br />
&nbsp;&nbsp;&nbsp;&nbsp;echo 'You cannot put "/" in trash.';<br />
&nbsp;&nbsp;&nbsp;&nbsp;exit 1;<br />
fi<br />
<br />
trashParentDir="&#36;(dirname &#36;1)";<br />
<br />
mkdir -p "&#36;trashParentDir/__trash__";<br />
mv -vft "&#36;trashParentDir/__trash__" "&#36;1";<br />
exit 0;</code></div></div><br />
Then I created 2 aliases:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>alias rm="trash"<br />
alias empty-trash="sudo find / -depth -type d -name &#92;"__trash__&#92;" -exec rm -r '{}' ';'"</code></div></div><br />
When using <span style="font-style: italic;" class="mycode_i">rm</span>, you actually put a file or folder into a <span style="font-style: italic;" class="mycode_i">__trash__</span> folder within the same directory. (Note: it will overwrite a pre-existing file of the same name previously 'deleted')<br />
In case of a mistake, just move the file out of the <span style="font-style: italic;" class="mycode_i">__trash__</span> folder.<br />
<br />
When using <span style="font-style: italic;" class="mycode_i">empty-trash</span>, you delete all <span style="font-style: italic;" class="mycode_i">__trash__</span> folders on the computer.  You need root privilege to do so.<br />
You could make a Cron job to empty-trash regularly.]]></description>
			<content:encoded><![CDATA[I've made a script to put a file or folder into a recycle bin instead of a deleting it with <span style="font-style: italic;" class="mycode_i">rm</span> (which could be problematic if you make an error).<br />
<br />
In a file called <span style="font-style: italic;" class="mycode_i">usr/bin/trash</span>, I've put the following:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#!/bin/bash<br />
<br />
# move a file or folder to a __trash__ folder (within the same directory)<br />
<br />
if [ "&#36;1" = "" ]; then<br />
&nbsp;&nbsp;&nbsp;&nbsp;echo "You need a file or folder name.";<br />
&nbsp;&nbsp;&nbsp;&nbsp;exit 1;<br />
elif [ "&#36;1" = "/" ]; then<br />
&nbsp;&nbsp;&nbsp;&nbsp;echo 'You cannot put "/" in trash.';<br />
&nbsp;&nbsp;&nbsp;&nbsp;exit 1;<br />
fi<br />
<br />
trashParentDir="&#36;(dirname &#36;1)";<br />
<br />
mkdir -p "&#36;trashParentDir/__trash__";<br />
mv -vft "&#36;trashParentDir/__trash__" "&#36;1";<br />
exit 0;</code></div></div><br />
Then I created 2 aliases:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>alias rm="trash"<br />
alias empty-trash="sudo find / -depth -type d -name &#92;"__trash__&#92;" -exec rm -r '{}' ';'"</code></div></div><br />
When using <span style="font-style: italic;" class="mycode_i">rm</span>, you actually put a file or folder into a <span style="font-style: italic;" class="mycode_i">__trash__</span> folder within the same directory. (Note: it will overwrite a pre-existing file of the same name previously 'deleted')<br />
In case of a mistake, just move the file out of the <span style="font-style: italic;" class="mycode_i">__trash__</span> folder.<br />
<br />
When using <span style="font-style: italic;" class="mycode_i">empty-trash</span>, you delete all <span style="font-style: italic;" class="mycode_i">__trash__</span> folders on the computer.  You need root privilege to do so.<br />
You could make a Cron job to empty-trash regularly.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[solved] ffmpeg on multiple .aac files in directory using find]]></title>
			<link>https://www.linuxliteos.com/forums/showthread.php?tid=6347</link>
			<pubDate>Wed, 07 Aug 2019 02:24:50 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.linuxliteos.com/forums/member.php?action=profile&uid=1675">Sprintrdriver</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.linuxliteos.com/forums/showthread.php?tid=6347</guid>
			<description><![CDATA[Hi.<br />
<br />
I have a folder with multiple .aac audio files. I plan to use them in a car stereo that is very picky on accepting files.<br />
<br />
So I found out using <a href="https://www.videohelp.com/software/ffmpeg" target="_blank" rel="noopener" class="mycode_url">ffmpeg</a> to clean out any unused metadata and possible other non-auditible information using this command:<br />
ffmpeg -i 'input.aac' -vn -c:a copy 'output.aac'<br />
<br />
I want to be able to do this for several files at once. According to [url=http://"https://unix.stackexchange.com/questions/80851/how-do-i-run-a-command-on-multiple-files"]this thread in unix.stackexchange forum[/url], it should be easilly done by using the <span style="text-decoration: underline;" class="mycode_u">find</span> command.<br />
<br />
However - I have tried several variation of the command (using the example from unix.stackexchange forum), but without any success (ffmpeg claim error about file existing). This is the commands I have tried so far:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>find . -name "*.aac" -exec ffmpeg -i {}  -vn -c:a copy 2_{}<br />
find . -name "*.aac" -exec ffmpeg -i {}  -vn -c:a copy 2_{} &#92;;<br />
find . -name "*.aac" -exec ffmpeg -i {}  -vn -c:a copy NEW{} &#92;;<br />
find . -name "*.aac" -exec ffmpeg -i {}  -vn -c:a copy NEW{}&#92;;<br />
find . -name "*.aac" -exec ffmpeg -i {}  -vn -c:a copy NEW{} &#92;;<br />
find . -name "*.aac" -exec ffmpeg -i '{}'  -vn -c:a copy 'NEW{}'&#92;;</code></div></div><br />
I usually got an error message like this (for every file):<br />
NEW./input-file-name.aac: No such file or directory<br />
<br />
I cannot 'see' the command that ffmpeg actually receive, so I cannot tell if there is an obviously error.]]></description>
			<content:encoded><![CDATA[Hi.<br />
<br />
I have a folder with multiple .aac audio files. I plan to use them in a car stereo that is very picky on accepting files.<br />
<br />
So I found out using <a href="https://www.videohelp.com/software/ffmpeg" target="_blank" rel="noopener" class="mycode_url">ffmpeg</a> to clean out any unused metadata and possible other non-auditible information using this command:<br />
ffmpeg -i 'input.aac' -vn -c:a copy 'output.aac'<br />
<br />
I want to be able to do this for several files at once. According to [url=http://"https://unix.stackexchange.com/questions/80851/how-do-i-run-a-command-on-multiple-files"]this thread in unix.stackexchange forum[/url], it should be easilly done by using the <span style="text-decoration: underline;" class="mycode_u">find</span> command.<br />
<br />
However - I have tried several variation of the command (using the example from unix.stackexchange forum), but without any success (ffmpeg claim error about file existing). This is the commands I have tried so far:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>find . -name "*.aac" -exec ffmpeg -i {}  -vn -c:a copy 2_{}<br />
find . -name "*.aac" -exec ffmpeg -i {}  -vn -c:a copy 2_{} &#92;;<br />
find . -name "*.aac" -exec ffmpeg -i {}  -vn -c:a copy NEW{} &#92;;<br />
find . -name "*.aac" -exec ffmpeg -i {}  -vn -c:a copy NEW{}&#92;;<br />
find . -name "*.aac" -exec ffmpeg -i {}  -vn -c:a copy NEW{} &#92;;<br />
find . -name "*.aac" -exec ffmpeg -i '{}'  -vn -c:a copy 'NEW{}'&#92;;</code></div></div><br />
I usually got an error message like this (for every file):<br />
NEW./input-file-name.aac: No such file or directory<br />
<br />
I cannot 'see' the command that ffmpeg actually receive, so I cannot tell if there is an obviously error.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[SOLVED]cronjob for clamav]]></title>
			<link>https://www.linuxliteos.com/forums/showthread.php?tid=6165</link>
			<pubDate>Sun, 05 May 2019 15:41:37 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.linuxliteos.com/forums/member.php?action=profile&uid=2257">osamu.morozumi</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.linuxliteos.com/forums/showthread.php?tid=6165</guid>
			<description><![CDATA[Hi,<br />
I'm trying to create a cron job for clamav to do a scan of the home directory once a week. I made this script in /etc/cron.weekly/ :<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#!/bin/sh<br />
clamscan -r /home/osamu/ | grep FOUND &gt;&gt; /home/osamu/virus-scan-reports/virus-scan-report.txt</code></div></div> following instructions from <a href="https://askubuntu.com/questions/749129/how-to-schedule-clamav-to-perform-a-daily-scan" target="_blank" rel="noopener" class="mycode_url">https://askubuntu.com/questions/749129/h...daily-scan</a>.  I looked in crontab but can't see any evidence of a new job there:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># m h dom mon dow user&nbsp;&nbsp;&nbsp;&nbsp;command<br />
17 *&nbsp;&nbsp;&nbsp;&nbsp;* * *&nbsp;&nbsp;&nbsp;&nbsp;root    cd / &amp;&amp; run-parts --report /etc/cron.hourly<br />
25 6&nbsp;&nbsp;&nbsp;&nbsp;* * *&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;&nbsp;&nbsp;test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.daily )<br />
47 6&nbsp;&nbsp;&nbsp;&nbsp;* * 7&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;&nbsp;&nbsp;test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.weekly )<br />
52 6&nbsp;&nbsp;&nbsp;&nbsp;1 * *&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;&nbsp;&nbsp;test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.monthly )<br />
#</code></div></div><br />
Am I missing a step?  Is there a better way to achieve automatic weekly scans?<br />
<br />
**edit:<br />
I deleted the script in /etc/cron.weekly and instead added this cronjob to /etc/crontab<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>0 18 * * SUN root rm -rf /var/log/clamav/freshclam.log<br />
1 18 * * SUN root freshclam<br />
2 18 * * SUN root clamscan -r -i / | grep FOUND &gt;&gt; /home/osamu/virus-scan-reports/virus-scan-report.txt</code></div></div><br />
This should update the malware database and scan  the entire system every sunday at 6pm and write it to a text file I hope.  Have I done this correctly and is there a way to dynamically append the current date to the name of the virus-scan text file?<br />
<br />
<br />
]]></description>
			<content:encoded><![CDATA[Hi,<br />
I'm trying to create a cron job for clamav to do a scan of the home directory once a week. I made this script in /etc/cron.weekly/ :<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#!/bin/sh<br />
clamscan -r /home/osamu/ | grep FOUND &gt;&gt; /home/osamu/virus-scan-reports/virus-scan-report.txt</code></div></div> following instructions from <a href="https://askubuntu.com/questions/749129/how-to-schedule-clamav-to-perform-a-daily-scan" target="_blank" rel="noopener" class="mycode_url">https://askubuntu.com/questions/749129/h...daily-scan</a>.  I looked in crontab but can't see any evidence of a new job there:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># m h dom mon dow user&nbsp;&nbsp;&nbsp;&nbsp;command<br />
17 *&nbsp;&nbsp;&nbsp;&nbsp;* * *&nbsp;&nbsp;&nbsp;&nbsp;root    cd / &amp;&amp; run-parts --report /etc/cron.hourly<br />
25 6&nbsp;&nbsp;&nbsp;&nbsp;* * *&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;&nbsp;&nbsp;test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.daily )<br />
47 6&nbsp;&nbsp;&nbsp;&nbsp;* * 7&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;&nbsp;&nbsp;test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.weekly )<br />
52 6&nbsp;&nbsp;&nbsp;&nbsp;1 * *&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;&nbsp;&nbsp;test -x /usr/sbin/anacron || ( cd / &amp;&amp; run-parts --report /etc/cron.monthly )<br />
#</code></div></div><br />
Am I missing a step?  Is there a better way to achieve automatic weekly scans?<br />
<br />
**edit:<br />
I deleted the script in /etc/cron.weekly and instead added this cronjob to /etc/crontab<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>0 18 * * SUN root rm -rf /var/log/clamav/freshclam.log<br />
1 18 * * SUN root freshclam<br />
2 18 * * SUN root clamscan -r -i / | grep FOUND &gt;&gt; /home/osamu/virus-scan-reports/virus-scan-report.txt</code></div></div><br />
This should update the malware database and scan  the entire system every sunday at 6pm and write it to a text file I hope.  Have I done this correctly and is there a way to dynamically append the current date to the name of the virus-scan text file?<br />
<br />
<br />
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[colourfind (either version of python, or pypy)]]></title>
			<link>https://www.linuxliteos.com/forums/showthread.php?tid=6111</link>
			<pubDate>Sat, 06 Apr 2019 00:06:18 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.linuxliteos.com/forums/member.php?action=profile&uid=2907">freemedia2018</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.linuxliteos.com/forums/showthread.php?tid=6111</guid>
			<description><![CDATA[usage:<br />
<br />
find | colourfind <br />
or:<br />
find | colourfind -d<br />
(which adds the date)<br />
<br />
since I'm new here, I expect that you wouldn't simply trust this code without some kind of vetting. It happens to be perfectly alright, but that isn't the point.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#!/usr/bin/env python3<br />
# coding: utf-8 <br />
#### license: creative commons cc0 1.0 (public domain) <br />
#### http://creativecommons.org/publicdomain/zero/1.0/ <br />
proginf = "colourfind, mar 2019 mn"<br />
<br />
import sys<br />
import os<br />
from datetime import datetime<br />
<br />
from sys import stdin, stdout<br />
from os import popen<br />
from os import name as osname<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
def colortext(f, b ):<br />
    if  f == None: <br />
        f = 0<br />
    if  b == None: <br />
        b = 0<br />
    n = "0"<br />
    if  f &gt; 7: <br />
        n = "1"<br />
        f = f - 8<br />
    if  f == 1: <br />
        f = 4 ## switch ansi colours for qb<br />
    elif f == 4: <br />
        f = 1<br />
    if  f == 3: <br />
        f = 6<br />
    elif f == 6: <br />
        f = 3<br />
    if  b &gt; 7: <br />
        b = b - 8<br />
    if  b == 1: <br />
        b = 4<br />
    elif b == 4: <br />
        b = 1<br />
    if  b == 3: <br />
        b = 6<br />
    elif b == 6: <br />
        b = 3<br />
    return "&#92;x1b[" + n + ";" + str(30+f) + ";" + str(40+ b ) + "m"<br />
<br />
def padleft(p, s, c=7):<br />
    if type( c ) == int:<br />
        c = (c, 0)<br />
    else:<br />
        c = c.split()<br />
    return colortext(int(c[0]), <br />
    int(c[1])) + (" " * s + str(p))[-s:] + colortext(7, 0)<br />
<br />
def padright(p, s, c="5 0"):<br />
    if type( c ) == int:<br />
        c = (c, 0)<br />
    else:<br />
        c = c.split()<br />
    return colortext(int(c[0]),<br />
    int(c[1])) + (str(p) + " " * s)[:s] + colortext(7, 0)<br />
<br />
def colourdc(c, f="p"):<br />
    if type( c ) != int: c = c.lower()<br />
    if c in [0, "0"]:<br />
        return "9 0"<br />
    cb = "0"<br />
    if len(f.split()) &gt; 1:<br />
        cb = "1"<br />
    if c in [2, ".bat", ".com", ".exe"]:<br />
        return "10 " + cb<br />
    if c in [1, ".lnk"]:<br />
        return "11 " + cb<br />
    if c in [".tgz", ".tar.gz", ".gz", ".zip", ".7z"]:<br />
        return "4 " + cb<br />
    if c in [".fig", ".alex", ".py", ".fig.py", ".rose"]:<br />
        return "2 " + cb<br />
    if c in [".ogg", ".mp4", ".mpeg", ".mpg", ".mp3", ".webm", ".odt",<br />
    ".odp", ".pdf"]:<br />
        return "3 " + cb<br />
    if c in ["."]:<br />
        return "8 " + cb<br />
    if c in [".jpg", ".jpeg", ".gif", ".bmp", ".pbm", ".pgm", ".ppm",<br />
    ".tga", ".xbm", ".xpm", ".tif", ".tiff", ".png", ".svg", ".svgz",<br />
    ".mng", ".pcx", ".mov", ".mpg", ".mpeg", ".m2v", ".mkv", ".ogm",<br />
    ".m4v", ".mp4v", ".vob", ".flc", ".avi", ".fli", ".flv", ".gl", <br />
    ".dl", ".xcf", ".xwd", ".yuv", ".cgm", ".emf", ".ogv"]:<br />
        return "13 " + cb<br />
    if c in [".htm", ".html", ".txt", ".js", ".php"]:<br />
        return "14 " + cb<br />
    return "7 " + cb<br />
<br />
dates = ""<br />
cw = 80<br />
sizel = 0<br />
<br />
dates = dates[1:]<br />
<br />
from os import listdir<br />
from os import path<br />
<br />
for fp in stdin:    <br />
    fp = fp[:-1]<br />
    b = []<br />
    bfext = 0<br />
    bp = 0<br />
    bfs = 0<br />
    bfiletime = 19<br />
  <br />
    try: <br />
        paths = 1<br />
        for p in chr(0):<br />
            p = fp<br />
            paths = 1<br />
            fext = path.splitext(fp + path.sep + p)[1]<br />
            if len(p) &gt; bfext:<br />
                bfext = len(p) <br />
<br />
            try: <br />
                fs = int(os.path.getsize(fp))<br />
                bfs = 0<br />
            except: <br />
                fs = ""<br />
<br />
            try: <br />
                if os.access(fp, os.X_OK):<br />
                    fext = 2<br />
                if os.path.isdir(fp):<br />
                    fext = 0 <br />
                if os.path.islink(fp):<br />
                    fext = 1 <br />
            except: <br />
                pass<br />
<br />
            try: <br />
                filetime = str(<br />
                datetime.fromtimestamp(os.path.getmtime(fp)))[0:19]<br />
            except: <br />
                filetime = ""<br />
<br />
            tab = chr(9)<br />
<br />
            pld = 1 <br />
            tab = chr(9)<br />
            bfile = tab + tab + padleft(str(filetime), bfiletime)<br />
            try: <br />
                flag = (sys.argv[1] == "-d")<br />
            except: <br />
                flag = 0<br />
            if not flag: <br />
                bfile = ""<br />
            print(str(fs) + " " + tab +  padright(p, <br />
            bfext, colourdc(fext, p)) + bfile)<br />
<br />
    except OSError: <br />
        pass</code></div></div>]]></description>
			<content:encoded><![CDATA[usage:<br />
<br />
find | colourfind <br />
or:<br />
find | colourfind -d<br />
(which adds the date)<br />
<br />
since I'm new here, I expect that you wouldn't simply trust this code without some kind of vetting. It happens to be perfectly alright, but that isn't the point.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#!/usr/bin/env python3<br />
# coding: utf-8 <br />
#### license: creative commons cc0 1.0 (public domain) <br />
#### http://creativecommons.org/publicdomain/zero/1.0/ <br />
proginf = "colourfind, mar 2019 mn"<br />
<br />
import sys<br />
import os<br />
from datetime import datetime<br />
<br />
from sys import stdin, stdout<br />
from os import popen<br />
from os import name as osname<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
def colortext(f, b ):<br />
    if  f == None: <br />
        f = 0<br />
    if  b == None: <br />
        b = 0<br />
    n = "0"<br />
    if  f &gt; 7: <br />
        n = "1"<br />
        f = f - 8<br />
    if  f == 1: <br />
        f = 4 ## switch ansi colours for qb<br />
    elif f == 4: <br />
        f = 1<br />
    if  f == 3: <br />
        f = 6<br />
    elif f == 6: <br />
        f = 3<br />
    if  b &gt; 7: <br />
        b = b - 8<br />
    if  b == 1: <br />
        b = 4<br />
    elif b == 4: <br />
        b = 1<br />
    if  b == 3: <br />
        b = 6<br />
    elif b == 6: <br />
        b = 3<br />
    return "&#92;x1b[" + n + ";" + str(30+f) + ";" + str(40+ b ) + "m"<br />
<br />
def padleft(p, s, c=7):<br />
    if type( c ) == int:<br />
        c = (c, 0)<br />
    else:<br />
        c = c.split()<br />
    return colortext(int(c[0]), <br />
    int(c[1])) + (" " * s + str(p))[-s:] + colortext(7, 0)<br />
<br />
def padright(p, s, c="5 0"):<br />
    if type( c ) == int:<br />
        c = (c, 0)<br />
    else:<br />
        c = c.split()<br />
    return colortext(int(c[0]),<br />
    int(c[1])) + (str(p) + " " * s)[:s] + colortext(7, 0)<br />
<br />
def colourdc(c, f="p"):<br />
    if type( c ) != int: c = c.lower()<br />
    if c in [0, "0"]:<br />
        return "9 0"<br />
    cb = "0"<br />
    if len(f.split()) &gt; 1:<br />
        cb = "1"<br />
    if c in [2, ".bat", ".com", ".exe"]:<br />
        return "10 " + cb<br />
    if c in [1, ".lnk"]:<br />
        return "11 " + cb<br />
    if c in [".tgz", ".tar.gz", ".gz", ".zip", ".7z"]:<br />
        return "4 " + cb<br />
    if c in [".fig", ".alex", ".py", ".fig.py", ".rose"]:<br />
        return "2 " + cb<br />
    if c in [".ogg", ".mp4", ".mpeg", ".mpg", ".mp3", ".webm", ".odt",<br />
    ".odp", ".pdf"]:<br />
        return "3 " + cb<br />
    if c in ["."]:<br />
        return "8 " + cb<br />
    if c in [".jpg", ".jpeg", ".gif", ".bmp", ".pbm", ".pgm", ".ppm",<br />
    ".tga", ".xbm", ".xpm", ".tif", ".tiff", ".png", ".svg", ".svgz",<br />
    ".mng", ".pcx", ".mov", ".mpg", ".mpeg", ".m2v", ".mkv", ".ogm",<br />
    ".m4v", ".mp4v", ".vob", ".flc", ".avi", ".fli", ".flv", ".gl", <br />
    ".dl", ".xcf", ".xwd", ".yuv", ".cgm", ".emf", ".ogv"]:<br />
        return "13 " + cb<br />
    if c in [".htm", ".html", ".txt", ".js", ".php"]:<br />
        return "14 " + cb<br />
    return "7 " + cb<br />
<br />
dates = ""<br />
cw = 80<br />
sizel = 0<br />
<br />
dates = dates[1:]<br />
<br />
from os import listdir<br />
from os import path<br />
<br />
for fp in stdin:    <br />
    fp = fp[:-1]<br />
    b = []<br />
    bfext = 0<br />
    bp = 0<br />
    bfs = 0<br />
    bfiletime = 19<br />
  <br />
    try: <br />
        paths = 1<br />
        for p in chr(0):<br />
            p = fp<br />
            paths = 1<br />
            fext = path.splitext(fp + path.sep + p)[1]<br />
            if len(p) &gt; bfext:<br />
                bfext = len(p) <br />
<br />
            try: <br />
                fs = int(os.path.getsize(fp))<br />
                bfs = 0<br />
            except: <br />
                fs = ""<br />
<br />
            try: <br />
                if os.access(fp, os.X_OK):<br />
                    fext = 2<br />
                if os.path.isdir(fp):<br />
                    fext = 0 <br />
                if os.path.islink(fp):<br />
                    fext = 1 <br />
            except: <br />
                pass<br />
<br />
            try: <br />
                filetime = str(<br />
                datetime.fromtimestamp(os.path.getmtime(fp)))[0:19]<br />
            except: <br />
                filetime = ""<br />
<br />
            tab = chr(9)<br />
<br />
            pld = 1 <br />
            tab = chr(9)<br />
            bfile = tab + tab + padleft(str(filetime), bfiletime)<br />
            try: <br />
                flag = (sys.argv[1] == "-d")<br />
            except: <br />
                flag = 0<br />
            if not flag: <br />
                bfile = ""<br />
            print(str(fs) + " " + tab +  padright(p, <br />
            bfext, colourdc(fext, p)) + bfile)<br />
<br />
    except OSError: <br />
        pass</code></div></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Conquer the Command Line v2 - Bash Essentials (free)]]></title>
			<link>https://www.linuxliteos.com/forums/showthread.php?tid=6024</link>
			<pubDate>Sat, 23 Feb 2019 23:58:08 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.linuxliteos.com/forums/member.php?action=profile&uid=71">bitsnpcs</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.linuxliteos.com/forums/showthread.php?tid=6024</guid>
			<description><![CDATA[Hello, <br />
<br />
the second Edition of this book is out now, it has 4 new chapters. <br />
<br />
Here is the link for the free Official download of it - <br />
<br />
<a href="https://www.raspberrypi.org/magpi-issues/Essentials_Bash_v2.pdf" target="_blank" rel="noopener" class="mycode_url">https://www.raspberrypi.org/magpi-issues...ash_v2.pdf</a>]]></description>
			<content:encoded><![CDATA[Hello, <br />
<br />
the second Edition of this book is out now, it has 4 new chapters. <br />
<br />
Here is the link for the free Official download of it - <br />
<br />
<a href="https://www.raspberrypi.org/magpi-issues/Essentials_Bash_v2.pdf" target="_blank" rel="noopener" class="mycode_url">https://www.raspberrypi.org/magpi-issues...ash_v2.pdf</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[SOLVED] Program error]]></title>
			<link>https://www.linuxliteos.com/forums/showthread.php?tid=6002</link>
			<pubDate>Fri, 15 Feb 2019 18:11:20 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.linuxliteos.com/forums/member.php?action=profile&uid=71">bitsnpcs</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.linuxliteos.com/forums/showthread.php?tid=6002</guid>
			<description><![CDATA[Hello, <br />
<br />
this is the script - <br />
<br />
<img src="https://i.ibb.co/x6nvNSK/menu-driven.png" loading="lazy"  alt="[Image: menu-driven.png]" class="mycode_img" /><br />
<br />
this is the error message on option 3 only<br />
<br />
<br />
<img src="https://i.ibb.co/JRQMWmN/menu-driven2.png" loading="lazy"  alt="[Image: menu-driven2.png]" class="mycode_img" /><br />
<br />
<br />
I set the shell script permissions to -<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>chmod 755</code></div></div><br />
As it was what the book specified to use in the first chapter of the shell scripting chapters. <br />
<br />
I checked the "18G..." results with error , by changing lines #33 and #36 by adding <br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sudo</code></div></div><br />
the program produces no error, but of course it needs the password to be typed, this confirmed the results of "18G...", as correct. In that the script, as in screenshot above, has the permission denied error but is producing the correct results shown on the next line in the terminal after the error, on the screenshot above.<br />
<br />
Options 1, 2, and 0 work without any errors in the program.<br />
The only changes I have made to the script from the book is to beautify the code alignment to my liking.<br />
The error happens before this when run, and still does, so it has not affected the programs functioning. <br />
<br />
I would like some help as to how to run this script on option3 without it producing the error.]]></description>
			<content:encoded><![CDATA[Hello, <br />
<br />
this is the script - <br />
<br />
<img src="https://i.ibb.co/x6nvNSK/menu-driven.png" loading="lazy"  alt="[Image: menu-driven.png]" class="mycode_img" /><br />
<br />
this is the error message on option 3 only<br />
<br />
<br />
<img src="https://i.ibb.co/JRQMWmN/menu-driven2.png" loading="lazy"  alt="[Image: menu-driven2.png]" class="mycode_img" /><br />
<br />
<br />
I set the shell script permissions to -<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>chmod 755</code></div></div><br />
As it was what the book specified to use in the first chapter of the shell scripting chapters. <br />
<br />
I checked the "18G..." results with error , by changing lines #33 and #36 by adding <br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sudo</code></div></div><br />
the program produces no error, but of course it needs the password to be typed, this confirmed the results of "18G...", as correct. In that the script, as in screenshot above, has the permission denied error but is producing the correct results shown on the next line in the terminal after the error, on the screenshot above.<br />
<br />
Options 1, 2, and 0 work without any errors in the program.<br />
The only changes I have made to the script from the book is to beautify the code alignment to my liking.<br />
The error happens before this when run, and still does, so it has not affected the programs functioning. <br />
<br />
I would like some help as to how to run this script on option3 without it producing the error.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Cat ate my homework]]></title>
			<link>https://www.linuxliteos.com/forums/showthread.php?tid=5668</link>
			<pubDate>Sat, 13 Oct 2018 12:47:49 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.linuxliteos.com/forums/member.php?action=profile&uid=71">bitsnpcs</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.linuxliteos.com/forums/showthread.php?tid=5668</guid>
			<description><![CDATA[Hello,<br />
<br />
I made this up as an exercise to do a combined practice for some recent commands I learned in the first few pages of chapter 20, and recent chapters. I thought it might give other beginners some ideas of how to play about with commands they learn and make some exercises for practice.<br />
<br />
<br />
<img src="https://preview.ibb.co/kMBWUU/s2.png" loading="lazy"  alt="[Image: s2.png]" class="mycode_img" /><br />
<br />
<br />
Here we use cat command to create a text file in the home directory using the command line.<br />
Also learning about using return/enter key to end the file, and then Ctrl D on the new line to exit editing .txt file back to the prompt.<br />
Then using cat in the way learned in earlier chapter (6) of The Linux Command Line book to display the contents of the (loyal) hungry-cat.txt file on the command line.<br />
Then using the find command to find our homework.txt file on the computer, and pipe command, then using cat to merge homework.txt contents and advice.txt and save the merge in the file named busted.txt.<br />
Then again using cat, this time to display the contents of the merged file, to check it merged the two file contents, the first line of busted.txt appearing after the merge is the text from inside the homework.txt file and the rest of busted.txt being the text inside the advice.txt file, the busted.txt is an empty text file to begin with with no text inside it.<br />
I got it wrong a few times but it was good practice using cat.<br />
<br />
Cat seems a straight forward way to make .txt files from the command line, useful for a variety of things, examples given of uses were documents, web pages (HTML, XML) , scripts.<br />
<br />
Edit - <br />
To replicate the results as shown you need to make all the text files used, using cat in the terminal is a good practice for this.<br />
If made using leafpad you may notice (as I did with the first 1 I tried) it appears with your username and prompt on the same line as the last line of text as you need to use the enter key to end a file with a new line then close it using the Ctrl D for the prompt to appear on its own new line, the book explains about ending the line using enter, but not what happens if you don't, such as when using leafpad, so this part was self learning by trying, and as it is likely to display this way with some leafpad files it is why I share info about what I noticed. So if you use cat to open a leafpad file and your prompt is not where you expect it to be we know why this is so, pressing enter key will move the prompt to a new line in its usual place.<br />
<br />
So this is why it was a good practice for remembering the correct way to make the txt files using cat in the command line, and to close and end them properly using cat on the command line.<br />
Which in the book it explains the difference in how MS DOS and Linux end lines in a different way using a different ASCII numbering, and the importance of spaces and end of lines characters even when they may not be visible (they can be made to be visible as code, which it also shows how to do) , this explains why some files created on windows may appear differently in Linux, it says that later in the chapter it will show ways to convert MS file formatting and end of lines to Unix/Linux format so it is more useful to us, which will also be a useful thing to learn. Also it will show how to make Linux formatting in to MS formatting.<br />
So in the few pages of the chapter 20 used so far, it covers quite a lot of new ideas to me , and maybe other learners too, I needed practice to retain this info.<br />
<br />
Looking at it it reminds me of a Python exercise to make a text based game which is run in the terminal , it showed examples of such games from the past, as the options and possible answers are stored as variables. So I think more advanced users can do something like this and make a text based game using the command line.<br />
Where each answer is a link to a text file that is then called using cat, run as part of a script showing an "alias" text in the game to hide the commands from the player, where the alias fits in to the game text/scenario.<br />
There are likely some other better ways but at this stage it is how I imagine that could be done.<br />
That way the .txt files would be sort of like a tree as a map/chart with the player choices linking to different branches/routes.<br />
I am not really in to games but I know many are, and I see how they can be used as a good way of learning commands as more of them would need to be used, and learned, in such a type of tutorial by the maker/s.]]></description>
			<content:encoded><![CDATA[Hello,<br />
<br />
I made this up as an exercise to do a combined practice for some recent commands I learned in the first few pages of chapter 20, and recent chapters. I thought it might give other beginners some ideas of how to play about with commands they learn and make some exercises for practice.<br />
<br />
<br />
<img src="https://preview.ibb.co/kMBWUU/s2.png" loading="lazy"  alt="[Image: s2.png]" class="mycode_img" /><br />
<br />
<br />
Here we use cat command to create a text file in the home directory using the command line.<br />
Also learning about using return/enter key to end the file, and then Ctrl D on the new line to exit editing .txt file back to the prompt.<br />
Then using cat in the way learned in earlier chapter (6) of The Linux Command Line book to display the contents of the (loyal) hungry-cat.txt file on the command line.<br />
Then using the find command to find our homework.txt file on the computer, and pipe command, then using cat to merge homework.txt contents and advice.txt and save the merge in the file named busted.txt.<br />
Then again using cat, this time to display the contents of the merged file, to check it merged the two file contents, the first line of busted.txt appearing after the merge is the text from inside the homework.txt file and the rest of busted.txt being the text inside the advice.txt file, the busted.txt is an empty text file to begin with with no text inside it.<br />
I got it wrong a few times but it was good practice using cat.<br />
<br />
Cat seems a straight forward way to make .txt files from the command line, useful for a variety of things, examples given of uses were documents, web pages (HTML, XML) , scripts.<br />
<br />
Edit - <br />
To replicate the results as shown you need to make all the text files used, using cat in the terminal is a good practice for this.<br />
If made using leafpad you may notice (as I did with the first 1 I tried) it appears with your username and prompt on the same line as the last line of text as you need to use the enter key to end a file with a new line then close it using the Ctrl D for the prompt to appear on its own new line, the book explains about ending the line using enter, but not what happens if you don't, such as when using leafpad, so this part was self learning by trying, and as it is likely to display this way with some leafpad files it is why I share info about what I noticed. So if you use cat to open a leafpad file and your prompt is not where you expect it to be we know why this is so, pressing enter key will move the prompt to a new line in its usual place.<br />
<br />
So this is why it was a good practice for remembering the correct way to make the txt files using cat in the command line, and to close and end them properly using cat on the command line.<br />
Which in the book it explains the difference in how MS DOS and Linux end lines in a different way using a different ASCII numbering, and the importance of spaces and end of lines characters even when they may not be visible (they can be made to be visible as code, which it also shows how to do) , this explains why some files created on windows may appear differently in Linux, it says that later in the chapter it will show ways to convert MS file formatting and end of lines to Unix/Linux format so it is more useful to us, which will also be a useful thing to learn. Also it will show how to make Linux formatting in to MS formatting.<br />
So in the few pages of the chapter 20 used so far, it covers quite a lot of new ideas to me , and maybe other learners too, I needed practice to retain this info.<br />
<br />
Looking at it it reminds me of a Python exercise to make a text based game which is run in the terminal , it showed examples of such games from the past, as the options and possible answers are stored as variables. So I think more advanced users can do something like this and make a text based game using the command line.<br />
Where each answer is a link to a text file that is then called using cat, run as part of a script showing an "alias" text in the game to hide the commands from the player, where the alias fits in to the game text/scenario.<br />
There are likely some other better ways but at this stage it is how I imagine that could be done.<br />
That way the .txt files would be sort of like a tree as a map/chart with the player choices linking to different branches/routes.<br />
I am not really in to games but I know many are, and I see how they can be used as a good way of learning commands as more of them would need to be used, and learned, in such a type of tutorial by the maker/s.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[wicked cool shell scripts Book]]></title>
			<link>https://www.linuxliteos.com/forums/showthread.php?tid=5650</link>
			<pubDate>Mon, 08 Oct 2018 06:00:34 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.linuxliteos.com/forums/member.php?action=profile&uid=1824">Moltke</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.linuxliteos.com/forums/showthread.php?tid=5650</guid>
			<description><![CDATA[Hi everyone! Hope you're all having a nice life. <img src="https://www.linuxliteos.com/forums/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" /><br />
<br />
A few weeks ago [member=411]bitsnpcs[/member]  had this great idea of creating threads for books we find interesting and worth reading. In the same spirit I now share this book and hope you find as interesting as I have. Here's the link so you ca get your fingers/clicks/tabs on it  ;D <br />
<br />
<a href="https://www.pdfdrive.com/wicked-cool-shell-scripts-wicked-cool-shell-scripts-e53155039.html" target="_blank" rel="noopener" class="mycode_url">https://www.pdfdrive.com/wicked-cool-she...55039.html</a><br />
<br />
<br />
]]></description>
			<content:encoded><![CDATA[Hi everyone! Hope you're all having a nice life. <img src="https://www.linuxliteos.com/forums/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" /><br />
<br />
A few weeks ago [member=411]bitsnpcs[/member]  had this great idea of creating threads for books we find interesting and worth reading. In the same spirit I now share this book and hope you find as interesting as I have. Here's the link so you ca get your fingers/clicks/tabs on it  ;D <br />
<br />
<a href="https://www.pdfdrive.com/wicked-cool-shell-scripts-wicked-cool-shell-scripts-e53155039.html" target="_blank" rel="noopener" class="mycode_url">https://www.pdfdrive.com/wicked-cool-she...55039.html</a><br />
<br />
<br />
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[ls /dev ]]></title>
			<link>https://www.linuxliteos.com/forums/showthread.php?tid=5611</link>
			<pubDate>Fri, 21 Sep 2018 23:55:58 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://www.linuxliteos.com/forums/member.php?action=profile&uid=71">bitsnpcs</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.linuxliteos.com/forums/showthread.php?tid=5611</guid>
			<description><![CDATA[Hello,<br />
<br />
In Chapter 15 of , The Linux Command Line, there is a command -<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sudo tail -f /var/log/messages</code></div></div><br />
It should produce a list and then a SD card is added , it is an example of how the kernel will notice the device and probe it. I can follow the example in the book.<br />
When I run this command (which is not an exercise in the book but I wanted to see it in action) I cannot get a result in terminal myself to then add a USB stick and watch this in action. Maybe the path needs to be different ?<br />
<br />
Earlier in the Chapter I had read this -<br />
"quote of Mr.Shotts - First let's look at how the system names devices. If we list the contents of the /dev directory (where all devices live), we can see that there are lots and lots of devices:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>ls /dev</code></div></div> "<br />
<br />
This gave me an idea to experiment using the above command, I was trying this below code to determine newly added device names by comparison -<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>ls /dev/sd*</code></div></div>My belief was it would show only those with sd naming using the wildcard *, I had learned previously in earlier chapters of "The Linux Command Line" about sd,  and about using wildcard.<br />
<br />
Below is a screenshot of my output, and source of my question<br />
<br />
<img src="https://preview.ibb.co/dT0EZz/Screenshot_2018_09_21_15_40_46.png" loading="lazy"  alt="[Image: Screenshot_2018_09_21_15_40_46.png]" class="mycode_img" /><br />
<br />
As you can see I ran the code , I then inserted a USB stick and used up arrow on keyboard to reuse the same code and run it again, thus allowing for a comparison of before and after adding the USB stick.<br />
It produced 2 new results the /dev/sdb and the /dev/sdb1 rather than the 1 new result I was expecting, why is this ?]]></description>
			<content:encoded><![CDATA[Hello,<br />
<br />
In Chapter 15 of , The Linux Command Line, there is a command -<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sudo tail -f /var/log/messages</code></div></div><br />
It should produce a list and then a SD card is added , it is an example of how the kernel will notice the device and probe it. I can follow the example in the book.<br />
When I run this command (which is not an exercise in the book but I wanted to see it in action) I cannot get a result in terminal myself to then add a USB stick and watch this in action. Maybe the path needs to be different ?<br />
<br />
Earlier in the Chapter I had read this -<br />
"quote of Mr.Shotts - First let's look at how the system names devices. If we list the contents of the /dev directory (where all devices live), we can see that there are lots and lots of devices:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>ls /dev</code></div></div> "<br />
<br />
This gave me an idea to experiment using the above command, I was trying this below code to determine newly added device names by comparison -<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>ls /dev/sd*</code></div></div>My belief was it would show only those with sd naming using the wildcard *, I had learned previously in earlier chapters of "The Linux Command Line" about sd,  and about using wildcard.<br />
<br />
Below is a screenshot of my output, and source of my question<br />
<br />
<img src="https://preview.ibb.co/dT0EZz/Screenshot_2018_09_21_15_40_46.png" loading="lazy"  alt="[Image: Screenshot_2018_09_21_15_40_46.png]" class="mycode_img" /><br />
<br />
As you can see I ran the code , I then inserted a USB stick and used up arrow on keyboard to reuse the same code and run it again, thus allowing for a comparison of before and after adding the USB stick.<br />
It produced 2 new results the /dev/sdb and the /dev/sdb1 rather than the 1 new result I was expecting, why is this ?]]></content:encoded>
		</item>
	</channel>
</rss>