summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2012-06-03 23:28:57 -0400
committerbnewbold <bnewbold@robocracy.org>2012-06-03 23:28:57 -0400
commit698a423afb8136e0820253bf23b0d195f4de1081 (patch)
treec775245014ffcd45db8e507b241eb08221eb0869
parente4398723bd0256b31e7ac3ad770fd3bdd0bd65e2 (diff)
downloadknowledge-698a423afb8136e0820253bf23b0d195f4de1081.tar.gz
knowledge-698a423afb8136e0820253bf23b0d195f4de1081.zip
small tricks
-rw-r--r--software/bash.page13
-rw-r--r--software/debian.page2
-rw-r--r--software/unix-tricks.page5
3 files changed, 19 insertions, 1 deletions
diff --git a/software/bash.page b/software/bash.page
index 2fa38be..f9eeb8c 100644
--- a/software/bash.page
+++ b/software/bash.page
@@ -10,6 +10,11 @@ BASH
Job Control
The syntax for "job number" or "JOBSPEC" (when using ``kill`` or similar) is ``%4`` or ``%5``.
+Startup
+-------
+``bash`` by default takes a very long time to initialize because the
+auto-completion scripts are loaded multiple times; disable this in
+``~/.bashrc``?
Piping
---------
@@ -18,3 +23,11 @@ You can pipe both ``stdout`` and ``stderr`` together either to a file or two ano
grep --asdf >& /some/file
grep --asdf |& less
+Network Access
+----------------
+You can directly access network sockets as if they were files from bash using
+the virtual devices ``/dev/tcp/HOSTNAME/PORT`` and ``/dev/udp/HOSTNAME/PORT``.
+
+printf
+------
+The ``printf`` command is much more powerful than "echo".
diff --git a/software/debian.page b/software/debian.page
index e4c24f5..32c0c5d 100644
--- a/software/debian.page
+++ b/software/debian.page
@@ -40,7 +40,7 @@ Some gotchas from installing debian a few times:
* ``bash`` by default takes a very long time to initialize because the
auto-completion scripts are loaded multiple times; disable this in
- ``~/.bashrc``?
+ ``~/.bashrc``? See also [bash].
* For building stuff you want ``build-essential``
diff --git a/software/unix-tricks.page b/software/unix-tricks.page
index 3573bc9..34c96d5 100644
--- a/software/unix-tricks.page
+++ b/software/unix-tricks.page
@@ -47,3 +47,8 @@ appropriate, and go through the output file to clean up the text.
$ sudo grep "bookmark_bar" --binary-files=text -B 10 -A 1000 /dev/sda5 | tee undeleted_content.txt
+Misc
+----
+``tput`` is useful for controlling the terminal cursor position, font style,
+etc.
+