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, […]
start job when cpu is idle with batch a command/process is started – when the CPU Load average gets below 0.8 = 80% but as you will see later – you can also make your own script to set your […]
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 […]
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 […]
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” […]
[cc lang=”bash” escaped=”true” width=”600″] ps -eo size,pid,user,command –sort -size | awk ‘{ hr=$1/1024 ; printf(“%13.2f Mb “,hr) } { for ( x=4 ; x
this is pretty confusing. SUID != GUID != sticky bit setuid and setgid (short for “set user ID upon execution” and “set group ID upon execution”, respectively)[1] are Unix access rights flags that allow users to run an executable with […]
in general: when changing groups for users the user needs to re-login to activate the changes Public and Private groups CentOS / Red Hat / Debian8 / UBuntu / Raspbian, use a private group scheme where for every new user […]
what for? various reasons. for example maybe the user wants to test download bandwidth by downloading a large file with random data and measure the bandwidth speed. lsb_release -a; # tested on No LSB modules are available. Distributor ID: Debian […]
routing is all about – TCP/IP and the route traffic/packages must/need/can take to the target (webserver, mailserver, youtube.com) and back. alias = “virtual network card” = you can have multiple ip-addresses per phyisical network card. under linux the naming is: […]
ip is the new ifconfig # show all network interfaces (physical and virtual) and their properties ip address show # or in short: ip a s 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback […]
[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 […]
screen basics For that, you might use the nohup command. But what if you want to start a command-line session on one computer and then go home and resume that session? For something like that, you’ll want to use screen. […]
file and folder and rights a user is only allowed to delete a file if he has WRITE access to the directory the file resides in. [cc lang=”bash” escaped=”true” width=”600″] id; # show userid and group id of currently logged […]
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 […]
this could be used to get an overview of – what files does the current user actually have read access to… [cc lang=”bash” escaped=”true” width=”600″] user@suse:~> # i assume you are not root, but “normal” user find /etc >result 2>errors; […]
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 […]
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; # […]
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 […]
firessh FireSSH is a free, cross-platform SSH terminal client for Mozilla Firefox and Google Chrome. Written entirely in Javascript! holy cow! I knew JavaScript was powerful 😀 you will have to type into firefox like this: ssh://login@IP example: ssh://user@172.20.0.25/ … […]
how to search replace in the whole text how to undo redo how to change selected text UPPERCASE to lowercase other examples: vim; # start vim # inside vim global search and replace :%s/search/replace/g vi testfile.txt; # open some file […]
[cc lang=”bash” escaped=”true” width=”600″] # interactive mode: # in your shell you can go $ # TAB, TAB, yes to see just the names of all environment variables printenv; # print all environment variables with content env; # print all […]
[cc lang=”bash” escaped=”true” width=”600″] # while working on the bash shell you can use those hotkeys user@host:^> type some word # Alt+Backspace – delete the last word user@host:^> type some # Alt+Backspace – delete the last word user@host:^> type # […]
find in all files with name “xyz” in all subdirectories and add .disabled at the end find all file*(s) and rename to file_renamed find . -type f -name ‘file*’ -print0 | xargs –null -I{} mv {} {}_renamed especially useful if […]
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 # […]
DDoS attacks are nasty stuff. Even such simple programs as – autobench – Automates the benchmarking of web servers using httperf – can sufficiently choke a webserver by spawning hundreds and thousands of mysql processes – exhausting all resources of […]