How to find your user SHELL and PATH on Linux
echo $PATH echo $SHELL
Which will print the paths to the screen
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games /bin/bash
How to find your user SHELL and PATH on Linux
echo $PATH echo $SHELL
Which will print the paths to the screen
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games /bin/bash
Here is a quick way to put the contents of a database table into a simple text file. This could be handy if for example, you just want to grab some emails and pop the results into a simple csv file. Your sql statement can be as creative as sql allows. All you are doing here is piping the query to mysql and then saving it to a file.
echo 'select concat(firstname, ', ', lastname, ', ', email) from email_subscribers' \ | mysql -uroot -p emails_database > emails.csv
To create a new user on Ubuntu (Heron8)
adduser johndoe
To create a new group
groupadd barleyfarmers
Add johndoe to the barleyfarmers group
adduser johndoe barleyfarmers
The adduser command, when you’re first adding the new user account, will prompt you for information pertaining to the account -name, phone, password, etc. If you want to change the password use the passwd command followed by the username for that account.
passwd johndoe