bash
shell
bashrc
tips-and-tricks
configuration
bash-scripting
shell-scripts
colorization
linux-shell
- Colorful console logging π
- Easy-to-remember aliases for many standard commands with optimal predefined params values
- Up to 70% economy of your keyboard input time β
- Collect, gather and show basic system stats for fast incidents investigation π
- Create file
/etc/banner
with$(hostname -s)
as context within figlet
Installation is so easy so even koala π¨ can do it. Read below! π
$ APP_USER="tbaltrushaitis" \
&& APP_NAME="bash-files" \
&& git clone https://github.com/${APP_USER}/${APP_NAME}.git \
&& cd ${APP_NAME} ;
$ make
+ | Input | Execute | Description |
---|---|---|---|
- | visits | f(<LOG_FILE>, [COUNT=10]) | Show top COUNT IPs extracted from LOG_FILE |
- | delempty | find . -type f -size 0 -exec rm -v {} ; | Find all empty files and delete them |
- | scs | screen -ls | Show list of active screens |
- | scx | screen -x | Attach to the screen which name is provided as parameter |
- | scr | screen -S "sockname" | Create new screen session with name provided as parameter, e.g. <pid>.sockname |
- | psnode | ps ax | grep node | Show node.js processes |
- | psport | ps -x | grep "${PORT}" | awk '{print $1}' | Show PID of process listeing on PORT |
- | zz | sudo -i | Become root |
- | exit | Exit current session | |
- | iip | f() | Show IP adress on ethernet/wi-fi |
- | conns | f() | Output list of ESTABLISHED network connections |
- | stripcomments | sed -r "/^(#|$)/d" -i <FILE> | Remove commented (starts with #) and blank lines from FILE |
- | nocomment | grep -Ev "^(#|$)" <FILE> | Show FILE contents without commented (starts with #) and blank lines |
- | cr2lf | sed -i 's/\r$//' <FILE> | Convert Windows (CRLF ) to Unix (LF ) in <FILE> |
- | unspace | f(<FILE>) | Replace spaces with dashes in FILE 's name |
- | pwg | pwgen -s1 32 | Generates strong 32-byte password |
- | mkd | f(<DIR_NAME>) | Create a new directory DIR_NAME and enter it |
- | count | find . -type f | wc -l | Recursively count files in the current directory |
- | npmi | npmi() | Install dependencies (if any provided) or from package.json file otherwise |
+ | Input | Execute | Description |
---|---|---|---|
- | med | mcedit -a | Run Midnight Commander's editor |
- | .. | cd .. | Go up 1 level |
- | c | clear | Clear terminal window |
- | screenls | screen -ls | Show list of active screens |
- | k9 | kill -9 | Send -HUP signal to process |
- | npmr | npm run | - |
- | npms | npm start | - |
- | npmt | npm run test | - |
- | npmb | npm run build | - |
- | npmo | npm outdated | - |
- | alert | notify-send --urgency | - |
- | chgrp | chgrp --preserve-root | - |
- | chmod | chmod --preserve-root | - |
- | chown | chown --preserve-root | - |
- | cp | cp -prb | - |
- | cpuinfo | lscpu | - |
- | curli | curl -I | - |
- | debug | set -o nounset; set -o xtrace | - |
- | df | df -kTH | - |
- | dir | dir --color | - |
- | du | du -kh | - |
- | egrep | egrep --color | - |
- | fastping | ping -c 100 -s.2 | - |
- | fgrep | fgrep --color | - |
- | grep | grep --color | - |
- | h | history | Show commands history |
- | headerc | curl -I --compress | - |
- | httpdtest | sudo /usr/sbin/apachectl -t && /usr/sbin/apachectl -S | - |
- | httpdreload | sudo /usr/sbin/apachectl -k graceful | - |
- | httpdrestart | sudo /etc/init.d/httpd restart | - |
- | ipt | sudo /sbin/iptables -n -v --line-numbers -L | - |
- | iptlist | ipt | - |
- | iptlistfw | ipt FORWARD | - |
- | iptlistin | ipt INPUT | - |
- | iptlistout | ipt OUTPUT | - |
- | firewall | iptlist | - |
- | j | jobs -l | - |
- | l | ls -CF | - |
- | la | ll -A | - |
- | lc | ls -ltcr | - |
- | libpath | echo -e ${LD_LIBRARY_PATH//:/\n} | - |
- | lk | ls -lSr | - |
- | ll | ls -lvF | - |
- | ln | ln -i | - |
- | lr | ll -R | - |
- | ls | ls --color | - |
- | lt | ls -ltr | - |
- | lu | ls -ltur | - |
- | lx | ls -lXB | - |
- | meminfo | free -m -l -t | - |
- | mkdir | mkdir -p | - |
- | most | du -shx * | grep -w "[0-9]*G" | - |
- | mount | mount | column -t | - |
- | partusage | df -hlT --exclude-type | - |
- | path | echo -e ${PATH//:/\n} | - |
- | ports | netstat -tulanp | - |
- | pscpu | ps auxf | sort -nr -k 3 | - |
- | pscpu10 | ps auxf | sort -nr -k 3 | head -10 | - |
- | psmem | ps auxf | sort -nr -k 4 | - |
- | psmem10 | ps auxf | sort -nr -k 4 | head -10 | - |
- | rights | f() | Set 775 on dirs, 664 on files and a+x on *.sh scripts |
- | rm | rm -i --preserve-root | - |
- | sha1 | openssl sha1 | - |
- | totalusage | df -hl --total | grep total | - |
- | usage | du -h --max-depth | - |
- | which | type -a | - |
## markdown of the above table prepared with this snippet:
$ echo "| + | Input | Execute | Description |" \
&& echo "|:-:|:-----:|:--------|:------------|" \
&& alias | cut -b7- | awk -F"=" '{print "| " $1 " | " $2 " |"}'
See the Changelog file for details
Note: We're ready to get help in creation of tomorrow web ... maybe its you just come there as a new contributor?
- GitHub / Basic writing and formatting syntax
- BitBucket / Markdown Howto
- Docker / Set up Automated Builds
π Developed on 20th of November 2016
π¦