nano mystatus.sh
Inside this file we are going to type:
df -h
ifconfig
This is supposed to show information about your disk space and interface (ip, mac address) Of course you could type any command in to this script. Press CTRL + O (save) when you are ready and CTRL + X to exit. (nano shows all the command in the bottom of terminal ^ means same as CTRL + letter.
To run shell script open terminal, locate the file and type
sh mystatus.sh
It should show the information we wanted.
Make the script runnable for everyone for everywhere
Insert in the beginning of the script this line:
#!/user/bin/env bash
It means it looks bash from every place, it can be used in any Linux version.
Then move it to /usr/bin
sudo mv mystatus.sh /usr/bin/
Give permissions
sudo chmod 755 mystatus.sh
And run from example your own user directory.
Ei kommentteja:
Lähetä kommentti