Install figlet
sudo apt install figlet
-
Create Your Script:
- Open a terminal and create your script file using:
nano cleanup.sh
- Open a terminal and create your script file using:
-
Make the Script Executable:
- Make the script executable by running:
chmod +x cleanup.sh
- Make the script executable by running:
-
Run Your Script:
- Execute your script with the following command:
./cleanup.sh
- Execute your script with the following command:
-
Move the Script to a Directory in Your PATH:
- To run the script using a single command, move it to a directory that is in your system's PATH:
sudo mv cleanup.sh /usr/local/bin/cleanup
- Alternatively, you can move it to
~/bin
:mv cleanup.sh ~/bin/cleanup
- To run the script using a single command, move it to a directory that is in your system's PATH:
-
Verify and Configure Your PATH:
- Ensure that the directory where you moved the script is in your PATH. Check your PATH with:
echo $PATH
- If
~/bin
is not in your PATH, add it by modifying your shell configuration file (e.g.,~/.bashrc
,~/.bash_profile
, or~/.zshrc
). Add the following line:export PATH="$HOME/bin:$PATH"
- Reload your shell configuration file to apply the changes:
source ~/.bashrc
- Ensure that the directory where you moved the script is in your PATH. Check your PATH with:
-
Run Your Script:
- Now you can run your script simply by typing:
cleanup
- Now you can run your script simply by typing: