Questions about Linux's BASH most used commands

Spud1200

Fully Optimized
Messages
2,570
Location
England, UK
Over the past couple of weeks I've been really trying to wrap my head around around writing my own bash scripts simply for the purpose of understanding more about what goes on under the hood of Linux.

I'm curious to know if anyone has any useful commands when writing there own scripts .

What I'm getting at is not necessarily the likes of your most used common commands like echo.

I've been asking google questions for days but don't seem to be getting any further forward.
I'll give you an example.

When writing a script and using the likes of the sleep command or for a user input something like yn and to end a script using the likes of end .

I'm most deffo not 100% on BASH Scripting, I'm pretty versed in the most used commands like grep, ls and overall navigating my way around the file system and even the like of du for example.

I really don't know how to explain what it is I'm trying to get at but say for example starting a program from the bash script and exiting a program, those commands what the likes of a pro would use when writing a new script .

If anyone can provide any commands to use with an explanation and even an example of how it would be executed would be a really big help.

I know this is a massive subject and its not possible to learn every command in the BASH man but at this point anything would be better than going back to google and banging my head against the wall.

:thumbsup:
 
I'm just curious Ste, do you have any Linux background knowledge. Do you have anything you cans hare, like any understanding of how say the directory's work, the file systems, or even any commands you can post for easy access when writing any scripts. :thumbsup:
 
I'm pretty versed in navigating my way around the Linux's BASH terminal threw the shell but what chokes me is there is still so much I need external help and feedback with when moving my way around the likes of Ubuntu server in regards to learning and memorizing the commands in regards to say for example SSH. The File System is pretty simple but again wanting to lean how to do automated scripts to run the likes of my VPN, do local jobs from my desktop and maybe my server would be a big leap forward for me.

At home now I have my Server and desktop but nothing in the way of anything complex set up in regards to a two way home network. I'm all ways looking to expand out and learn new things but as posted in the forum feedback section expanding in to mobile tech might be something worth looking in too say even with a cheap tablet given with something like WiFi.

At the minute I'm running mint and use Firefox, my system from a physical interaction stand point is pretty secure even to the point of disabling the likes of sudo.

If you are interested in posting anything to do with Linux's BASH ill start by sharing something I recently learned in regards to the Mint 21.x series .

Hears something:

-----------------------

Add your self to the sudo group then follow what I done when it comes to online reading .

Open the terminal and execute: sudo xed /etc/passwd

Locate the line (usually line 1) starting with: root:x:0:0:root:/root:/bin/
bash

Modify this line to: root:x:0:0:root:/root:/usr/sbin/nologin


Save the changes by clicking "Save" and then close the editor by clicking
the "X" button, or use CTRL + S and then close the editor.


Then,


Open the terminal and run: sudo xed /etc/ssh/ssh_config
Scroll to the end of the ssh_config file (usually line 54)

Add the line: PermitRootLogin no

If the PermitRootLogin line is already present, change it from PermitRoot
Login yes to PermitRootLogin no


Save the changes by clicking "Save" and then close the editor by clicking
the "X" button, or use CTRL + S and then close the editor.


Then again,


Open the terminal and execute: sudo xed /etc/shadow

Locate the line (usually line 1) starting with root:
Add a"i" in front of root:, changing it to iroot:

Save the changes by clicking "Save" and then close the editor by clicking
the "X" button, or use CTRL + S and then close the editor.


When I done this it worked for me and when trying to execute sudo commands I wasn't able to .

When installing something like an Ubuntu System or derivative Luks encryption is pretty secure.

I know there is practically countless things you can do to lock down your system but this was just one example of something I learned recently for the Mint series but again in FF theirs things you can do to secure your connection and stop certain things happening like leaking your IP address, Geo Location and the likes like of WebRTC .

If theirs anything you can post I'm hear listening. :thumbsup:
 
Back
Top Bottom