Watching a bash Script at Work
Sometimes it is helpful to watch what a bash script is actual doing. This can be done with the parameter -x:
$ bash -x <script>
sort: Change Directory for Temporary Files
To change the directory for temporary files during sort use the parameter -T:
$ sort -T /var/big_filesystem file_to_sort
This can be helpful, if you sort a big file and the default directory (/tmp
) is full or too small.
Check the Syntax of a Shell Script
$ bash -n <script>
Does not execute the script, checks the syntax.
Increase and Decrease Numbers in vim
Set the cursor onto a number and press Ctrl-A
to increase it or Ctrl-X
to decrease it.