touch hello-world.sh
nano hello-world.sh
` #!/bin/sh
echo Hello World `
first shortcut will save the file and second shortcut will exit the nano termianl editor.
bash hello-world.sh
and this will show you the output. and voilah! you sucessfully learned how to create files using touch command and editing using nano editor and running a bash script with bash command.
- Create a file using bash command:
touch <filename>
var="Hello World"echo "\$var"pwdlscdmkdir Demomv Demo/*.py Demo/Pythonfilestouch foo.txtrm foo.txtrmdir : rmdir stands for remove directory and is used to remove empty directories from the filesystem
rmdir ../Pythonfiles/