Bash is shell and command language which helps automize the many processes/scripts in Deep Learning experiments. Here we provide a step by step introduction to bash scripting which is an essential tool for a good Deep Learning researcher.
Let's start with the syntax in general.
The shebang (#!/bin/bash) at the beginning of a script specifies the interpreter to be used when executing the script. The shebang should always be the first line of your script. In this case, /bin/bash is the path to the Bash interpreter.
Comments in Bash scripts begin with a hash symbol (#) and continue to the end of the line. Comments are ignored by the interpreter.
Commands in a Bash script are executed line by line, just as they would be in a terminal. For example:
echo "This line will be displayed."
Check file size:
du -sh /some/folder
-h for the human readable format, -s for grand total size of the folder.
Create a file:
create a folder:
Delete a file:
delete a folder
rm -r some/
Rename or move a folder:
Copy a file:
cp some/folder/file.py /new/location/
copy a folder:
cp -r some/folder/ /new/location/