Category: Bash / Terminal / Scripts

gnu linux server and partitioning – stability and security
19.05.2017

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 […]

19.05.2017

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” […]

19.05.2017

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 […]

16.05.2017

messing with text files test content # test if /path/file contains SEARCH_PATTERN if grep -q SEARCH_PATTERN “/path/file”; then cat /path/file; # do something fi paste basically line-wise combines two files into one. (first line of two files will end up […]

16.05.2017

Mac OS X Using Homebrew (yes, I am opinionated) you can install the following tools with the following packages: brew install proctools # to install pgrep, pkill, etc. brew install pstree # to be able to use pstree brew install […]

16.05.2017

CentOS7 [cc lang=”bash” escaped=”true” width=”600″] yum install psmisc # install pstree [root@centos user]# pstree systemd─┬─NetworkManager─┬─dhclient │ └─2*[{NetworkManager}] ├─agetty ├─auditd───{auditd} ├─chronyd ├─crond ├─dbus-daemon───{dbus-daemon} ├─firewalld───{firewalld} ├─irqbalance ├─lvmetad ├─polkitd───5*[{polkitd}] ├─rsyslogd───2*[{rsyslogd}] ├─sshd─┬─sshd───sshd───bash───su───bash───pstree │ └─sshd───sshd───sftp-server ├─systemd-journal ├─systemd-logind ├─systemd-udevd ├─tuned───4*[{tuned}] └─xinetd [/cc] debian8 [cc lang=”bash” escaped=”true” […]

03.05.2017

[cc lang=”bash” escaped=”true” width=”600″] setterm -blength 0; # turns off nerve wrecking “BELL” echo ‘setterm -blength 0; # turns off nerve wrecking “BELL”‘ >> /etc/bash.bashrc; # make the changes permanent/survive boot and for all users [/cc] this does not work […]

26.04.2017

will output a nicely formatted list of all users to “users_all.txt” but also print on screen (tee) (for whatever reason the current date-time is at the very top) cut -d: -f1 /etc/passwd|sort|pr -1 |grep -v ‘^$’|tee users_all.txt what has been […]

26.04.2017

based on preparation of: dwaves.de/2017/04/26/linux-bash-searching-and-colorful-highlighting-of-text-patterns-in-files-with-grep-regular-expressions/ [cc lang=”bash” escaped=”true” width=”600″] wc -w; # basically starting wc in “interactive” mode, quit with Ctrg+Z joe is very hungry today 5 wc -w < termine; # word count, count the words in that file […]

26.04.2017

probably the most useless of all command combinations… but for whatever reason… like you don’t have an editor that can only write but not read files: it will just keep overwriting the file… [cc lang=”bash” escaped=”true” width=”600″] cat editor_for_poor.txt; # […]

Linux Bash searching and colorful highlighting of text patterns in files with grep regular expressions
26.04.2017

Sorry! article has moved to: https://dwaves.de/2015/06/12/linux-bash-find-search-file-content-text-string-output-file-list-iterate-over-file-list-colorful-mark-search-term-lines/ the system appologizes for your inconveniance and the waste of electricity, bandwith and (cpu but also brain) time… if you have the evil javascript enabled… you will be redirected immediately. otherwise please click the […]

23.04.2017

apt-get update; apt-get install p7zip-full; # install software vim /scripts/un7zip.sh; # create a new bash script file # insert this: [cc lang=”bash” escaped=”true” width=”600″] #!/bin/bash cd $1; for arc in *.7z do 7z x -y “$arc” done [/cc] :wq # […]