<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://techdoku.nogafam.es/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://techdoku.nogafam.es/feed.php">
        <title>NoBIGTech Wiki Técnico - docu:csheet:sysadm:script:bash</title>
        <description></description>
        <link>https://techdoku.nogafam.es/</link>
        <image rdf:resource="https://techdoku.nogafam.es/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-04-17T07:37:17+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:cr_remove_tr&amp;rev=1589022434&amp;do=diff"/>
                <rdf:li rdf:resource="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:expand_aliases&amp;rev=1581686109&amp;do=diff"/>
                <rdf:li rdf:resource="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:get_script_path&amp;rev=1600263459&amp;do=diff"/>
                <rdf:li rdf:resource="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:grep_displayonly&amp;rev=1584952869&amp;do=diff"/>
                <rdf:li rdf:resource="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:hex_convertions&amp;rev=1600783114&amp;do=diff"/>
                <rdf:li rdf:resource="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:rename_spaces&amp;rev=1595887782&amp;do=diff"/>
                <rdf:li rdf:resource="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:tcp_raw_bash&amp;rev=1582123103&amp;do=diff"/>
                <rdf:li rdf:resource="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:tcpdump_stdbuf_traffic&amp;rev=1583917668&amp;do=diff"/>
                <rdf:li rdf:resource="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:wget_all_website&amp;rev=1610581674&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://techdoku.nogafam.es/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>NoBIGTech Wiki Técnico</title>
        <link>https://techdoku.nogafam.es/</link>
        <url>https://techdoku.nogafam.es/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:cr_remove_tr&amp;rev=1589022434&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-05-09T11:07:14+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>cr_remove_tr</title>
        <link>https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:cr_remove_tr&amp;rev=1589022434&amp;do=diff</link>
        <description>Remove ^M CR (carriage return) from output/file




^M is a carriage return (CR), which can be specified as \r for tr or within $&#039;…&#039;. \n specifies a line feed (LF), which is ^J. A Unix line ending is LF, and a Windows line separator is the two-character sequence CR-LF, so Windows text files viewed under a Unix system such as Linux or macOS look like they have ^M at the end of each line except on the last line which is missing its final newline.</description>
    </item>
    <item rdf:about="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:expand_aliases&amp;rev=1581686109&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-02-14T13:15:09+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>expand_aliases</title>
        <link>https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:expand_aliases&amp;rev=1581686109&amp;do=diff</link>
        <description>Expand aliases on a bash script

In order to use aliases inside a bash script,

we need to issue this command inside a shell:


#!/bin/bash
shopt -s expand_aliases
source ~/.bash_aliases
your_alias1
your_alias2</description>
    </item>
    <item rdf:about="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:get_script_path&amp;rev=1600263459&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-09-16T13:37:39+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>get_script_path</title>
        <link>https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:get_script_path&amp;rev=1600263459&amp;do=diff</link>
        <description>Get directory of the executed script in bash



Simple, straight forward:


SCRIPTPATH=&quot;$( cd &quot;$(dirname &quot;$0&quot;)&quot; &gt;/dev/null 2&gt;&amp;1; pwd -P )&quot;</description>
    </item>
    <item rdf:about="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:grep_displayonly&amp;rev=1584952869&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-03-23T08:41:09+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>grep_displayonly</title>
        <link>https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:grep_displayonly&amp;rev=1584952869&amp;do=diff</link>
        <description>Use grep text to only highlight it showing original text


a_long_text_command | grep --color -E &#039;YOURSEARCH|$&#039;</description>
    </item>
    <item rdf:about="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:hex_convertions&amp;rev=1600783114&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-09-22T13:58:34+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>hex_convertions</title>
        <link>https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:hex_convertions&amp;rev=1600783114&amp;do=diff</link>
        <description>Convertions and replacements on Linux command line using hex



Here is some hex operations you can do with basic or built-in GNU Linux tools:



Convert a given string to hex using xxd


echo -ne &#039;your.wanted.string!&#039; | xxd  -p




Replace a hex string on binary file using</description>
    </item>
    <item rdf:about="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:rename_spaces&amp;rev=1595887782&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-07-27T22:09:42+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>rename_spaces</title>
        <link>https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:rename_spaces&amp;rev=1595887782&amp;do=diff</link>
        <description>Remove spaces from files in a directory recursively



Source: &lt;https://stackoverflow.com/questions/2709458/how-to-replace-spaces-in-file-names-using-a-bash-script&gt;



Install the package

apt-get install rename



Rename the dirs first, then the files


find -name &quot;* *&quot; -type d | rename &#039;s/ /_/g&#039;
find -name &quot;* *&quot; -type f | rename &#039;s/ /_/g&#039;</description>
    </item>
    <item rdf:about="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:tcp_raw_bash&amp;rev=1582123103&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-02-19T14:38:23+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>tcp_raw_bash</title>
        <link>https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:tcp_raw_bash&amp;rev=1582123103&amp;do=diff</link>
        <description>Check a TCP connection and response on raw BASH



Sometimes you don&#039;t have the proper tools to check connectivity to a site (curl, nc, ping)
but you have a bash shell, so you can use bash built-in functions to do this.


exec 3&lt;&gt;/dev/tcp/127.0.0.1/8080 &amp;&amp; echo -ne &#039;GET /index.html\n\n&#039; &gt;&amp;3 &amp;&amp; cat &lt;&amp;3 2&gt;/dev/null</description>
    </item>
    <item rdf:about="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:tcpdump_stdbuf_traffic&amp;rev=1583917668&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-03-11T09:07:48+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>tcpdump_stdbuf_traffic</title>
        <link>https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:tcpdump_stdbuf_traffic&amp;rev=1583917668&amp;do=diff</link>
        <description>Analyze HTTP traffic with simple command line tools



This “simple” and yet effective command will show all the incoming/outgoing HTTP GET and POST plain requests.


stdbuf -oL -eL tcpdump -A -s 10240 &quot;tcp port 80 and (((ip[2:2] - ((ip[0]&amp;0xf)&lt;&lt;2)) - ((tcp[12]&amp;0xf0)&gt;&gt;2)) != 0)&quot; | \
    egrep -a --line-buffered &quot;.+(GET |HTTP\/|POST )|^[A-Za-z0-9-]+: &quot; | \
    perl -nle &#039;BEGIN{$|=1} { s/.*?(GET |HTTP\/[0-9.]* |POST |HEAD )/\n$1/g; print }&#039;\n</description>
    </item>
    <item rdf:about="https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:wget_all_website&amp;rev=1610581674&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-01-13T23:47:54+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>wget_all_website</title>
        <link>https://techdoku.nogafam.es/doku.php?id=docu:csheet:sysadm:script:bash:wget_all_website&amp;rev=1610581674&amp;do=diff</link>
        <description>Download/Get/Scrap/Crawl all static files from website using Wget



We will use the justdeleteme.xyz website as a good example of this usage, because it only contains static files to host everything, but it needs multiple recursive crawls to download pages in all languages.</description>
    </item>
</rdf:RDF>
