update: safety first! when it comes to important files: safety comes first thus recommend to the user that wants to go pro the following backup system: have two complete backups at two different places: backupA: at the company, USB 3.0 […]
display ip and ip only of the host computer the script is running on. ifconfig eth0|grep inet| awk ‘{print $2}’ | cut -d: -f2 172.20.0.8 root@debian9:~# IP=$(ifconfig eth0|grep inet| awk ‘{print $2}’ | cut -d: -f2); echo $IP; 172.20.0.8
there are some special automatically set environment variabels that might be interesting to know… echo $$; # PID of currently running shell echo $?; # return error code of last run program (before echo) echo $0; # return /path/and/way the […]
upgrade 2024: python based colorize.py means: customize colors + keywords + SCROLLABLE output! 😀 1. make sure to modify terminal and set a green-on-black color profile: 2. download + run: su – root wget https://dwaves.de/software/python/colorize.py.txt mkdir /scripts mv colorize.py.txt /scripts/colorize.py […]
naming why is a shell called a shell? after all it’s just a program 😀 call it program then 😀 kernel = core, shell = surrounding the core, interaction with the core. a shell is also a runtime-environment – a […]
return value: any exit/return/result value other than 0 is considered an error. you can output the return value of the last command like this: echo $? 0 inside a script you can exit and return an exit code like this: […]
vi countdown.sh; # create a new file with those lines #!/bin/bash COUNT=10 while (( COUNT > 0 )) do echo -e “$COUNT \c” sleep 1; (( COUNT — )) done echo -e “\n\nWe have lift off!!” ESC […]
iconv.man.txt – allows (file?) conversion between charsets / encodings all available encodings: iconv_debian8_convertable_charsets.txt example: iconv -f UTF-8 -t ISO-8859-15 file.input -o file.output file file.output file.output ASCII text iconv -f ASCII -t UTF-8 file.input -o file.output file.output: ASCII text
# all these commands will modify /etc/passwd su – root # disable login for user usermod -s /usr/sbin/nologin username # change login-shell of username to bash usermod -s /bin/bash username # change login-shell of username to sh usermod -s /bin/sh […]
stat /etc/hosts File: ‘/etc/hosts’ Size: 249 Blocks: 8 IO Block: 4096 regular file Device: 801h/2049d Inode: 5506941 Links: 1 Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2017-06-06 15:37:06.896148382 +0200 Modify: 2017-06-06 15:37:04.728130437 +0200 Change: […]
about package.deb & apt update: 2025-01: apt got a massive rewrite in Debian 13 Trixie (66% C++ 30% shell) # check the changelog with su – root apt-get changelog apt Apt is a mainly-online-repository-based (“AppStore”) software installation & package management […]
one practical usage example of xargs: … to process every file that find found further # this would backup/pack all jpg files on your system into all.jpg.tar.gz find / -name “*.jpg” | xargs tar -czvf all.jpg.tar.gz # delete all jpg […]
lvm2 concept: tested on: debian 8-9 and compatible, manpages from centos7/rhel7 in general backup! backup! backup! before fiddeling with partitions and the filesystem… logical volumes basically allow you to span partitions over several disks/partitions as well as resize those partitions. […]
article was merged with: https://dwaves.de/2017/05/16/linux-bash-terminal-howto-string-text-processing-examples/
what is umask? umask defines what what access rights newly created files “are born”. we are all supposed to be created equal – but depending if you are a son of Rothchild, Rockefeller or born in Namibia – your previleges […]
update: 2021-1 yum -> dnf hostnamectl; # tested on Virtualization: kvm Operating System: CentOS Linux 8 CPE OS Name: cpe:/o:centos:centos:8 Kernel: Linux 5.4.11 Architecture: x86-64 ll /usr/bin/yum -> dnf-3 all those yum commands still work with dnf (nice work!) DNF […]
reboot [cc lang=”bash” escaped=”true” width=”600″] reboot; # simply reboots the system 😉 init 6; # does the same telinit 6; # shutdown -r now; # “standard” way shutdown -r +1 “the system is going to reboot in one minute”; # […]
Table 4-1. Regular expression operators Operator Effect . Matches any single character. ? The preceding item is optional and will be matched, at most, once. * The preceding item will be matched zero or more times. + The preceding item […]
lsb_release -a; # tested on Description: Debian GNU/Linux 10 (buster) # output all lines that containt KEYWORD grep KEYWORD file.txt # output all lines that DO NOT containt KEYWORD (search inverted) grep -v KEYWORD file.txt # -v, –invert-match # […]
Some people think it is ridiculous to measure the power consumption of computers. Imho it is important for servers but also if workstation uses 50 Watts idle or 10 can also make a difference when it is used a lot […]
if you want to send mail from a client not from a server – you will need: some client software valid account on an external mail server warning! Sendemail is unable to accept self-signed SSL certificates… so you will need […]
cool apt-get install fortune cowsay; # will have to be installed first then you can let your dinosaur speak 😀 /usr/games/cowsay -f stegosaurus “Hello World” _____________ < Hello World > ————- \ . . \ / `. .’ ” […]
[cc lang=”bash” escaped=”true” width=”600″] man -k bash; # search for bash in all man-pages bash (1) – GNU Bourne-Again SHell bash-builtins (7) – bash built-in commands, see bash(1) bashbug (1) – report a bug in bash builtins (7) – bash […]
for good overview it makes sense to label the harddisk partitions according to functionality (what is their purpose?) GNU Linux bash – how to label partitions tune2fs (xfs & ext4) uname -a; # tested with Linux debian 3.16.0-4-686-pae #1 SMP […]
these commands are equally valid, both commands add “content” to the end of file – if file does not exists it will be created. ls -l . /ect > listing.txt #send the output from ls -l to a file called […]
yeah one knows sometimes making fun of distributions that have a partition for every /root/folder but well yes it has it’s reasons, like when a program accumulates to much data (mailbox full), the /root partition and the system will not […]
there are plenty 😀 debian8.8 [cc lang=”bash” escaped=”true” width=”600″] uname -a; # tested with Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.43-2 (2017-04-30) i686 GNU/Linux find / -type d -iname bin /bin /usr/local/bin /usr/bin /usr/share/doc/libintl-perl/examples/simplecal/bin /usr/lib/klibc/bin [/cc] suse12 [cc lang=”bash” escaped=”true” […]
rpm is a powerful Package Manager for Red Hat, Suse and Fedora Linux. It can be used to build, install, query, verify, update, and remove/erase individual software packages. A Package consists of an archive of files, and package information, including […]
per-user scheduling per default cron will complain if the syntax of your cronfile is wrong straight after saving the file. uname -a; # tested with Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.43-2 (2017-04-30) i686 GNU/Linux user@suse12:~> crontab -l; # check […]
in general unfortunately the minimum time-unit usable with at is minutes – no seconds or milliseconds. timing non-repetative tasks tasks that are just run once but at a certain time or date at ist not installed per default under centos/redhat, […]









