Копилка интересного про шеллы
Маленькие хитрости, конкретные команды
Esc _ (Esc, затем подчеркивание), Alt + ., $_ -- последний аргумент предыдущей команды
Полезно и при интерактивной работе, и при составлении примеров и инструкций
mkdir /some/complicated/path cd $_
Ctrl+w -- стереть слово слева от курсора
Alt+b, Alt+f -- перемещаться влево и вправо по началам слов
TODO: редактирование текущей команды в $EDITOR
gpg --edit-key Your-Key-ID-Here gpg> passwd gpg> save
"Experience is the name everyone gives to their mistakes." -- Oscar Wilde
Want to make apt-get install less noisy at a shell prompt or in a script? apt-get -qq update >/dev/null apt-get upgrade -qq -y > /dev/null
Use vim to edit files over the network using ssh on a Linux/Unix/OSX/BSD: vim scp://user@server//home/user/file
Exclude files at a bash: shopt -s extglob List all except *.py ls !(*.py) rm all except *.pl rm !(*.pl)
If you start editing httpd.conf without root & wanted to save without root permission, try: :w !sudo tee %
A simple shell script to add users to #MySQL/#MariaDB
screencapture + scp
screen -S foo -m -d program
Отдельные ситуации, сложные инструменты
Want to view/open compressed file on a Unix/Linux/OSX/BSD?
zgrep word file zcat file
More info on z* commands
collection of zsh shell tips for Unix/Linux/OSX/BSD users and sysadmins
Want to easily find out which process are eating too much bandwidth on a Linux?
This article will cover one interesting old-school Unix hacking technique, that will still work nowadays in 2013. Hacking technique of which (to my suprise) even many security-related people haven't heard of. That is probably because nobody ever really talked about it before. Why I decided to write on this subject is because, to me personally, it's pretty funny to see what can be done with simple Unix wildcard poisoning tricks. So, from this article, what you can expect is collection of neat *nix hacking tricks that as far as I know somehow didn't emerge earlier. If you wonder how basic Unix tools like 'tar' or 'chown' can lead to full system compromise, keep on reading.
Tmux is great, except when you have to restart the computer. You lose all the running programs, working directories, pane layouts etc. There are helpful management tools out there, but they require initial configuration and continuous updates as your workflow evolves or you start new projects.
tmux-resurrect saves all the little details from your tmux environment so it can be completely restored after a system restart (or when you feel like it). No configuration is required. You should feel like you never quit tmux.
ShellCheck is a static analysis and linting tool for sh/bash scripts. It's mainly focused on handling typical beginner and intermediate level syntax errors and pitfalls where the shell just gives a cryptic error message or strange behavior, but it also reports on a few more advanced issues where corner cases can cause delayed failures.
AGREP - approximate GREP for fast fuzzy string searching. Files are searched for a string or regular expression, with approximate matching capabilities and user-definable records. Developed 1989-1991 by Udi Manber, Sun Wu et al. at the University of Arizona. ISC open source license since Sept. 2014.
“One thing well” misses the point: it should be “One thing well AND COMPOSES WELL”
Consume input from stdin, produce output to stdout.
Output should be free from headers or other decoration.
Output should be simple to parse and compose.
Treat a tool’s output as an API.
Place diagnostics output on stderr.
Signal failure with an exit status.
Make a tool’s output portable.
Omit needless diagnostics.
Avoid making interactive programs.
This cheat sheet is useful if you're learning Linux and want to have a quick overview of all the available commands
Bonus: Here are some of the commands that was used to create the cheat sheet: $ curl 'http://www.gnu.org/software/coreutils/manual/coreutils.html' 2>/dev/null | grep 'h3 class' | grep 'class="command"' | sed 's/.*class="command">//' | sed 's|</span></samp>||' | sed 's|</h3>||' | grep ':' | sort
Почему Ubuntu перешли на dash как на дефолтный шелл
repository contains the virtual machine, data, scripts, and custom command-line tools used in the book Data Science at the Command Line.
Интересно посмотреть на программу: какие аспекты shell-программирования вообще существуют
Нестандартные расширения, дополнения
Bish is a language that compiles to Bash. It's designed to give shell scripting a more comfortable and modern feel.