Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - edizgeorgi

#1
You can use the cut command which will select the specified column.
$cat /etc/passwd | cut -d : -f 1
Reference: https://www.networking-forums.com/programming-goodies-and-software-defined-networking/list-only-usernames

#3
It is easier than you think. Use the usermod command with root privileges. Following example will remove the user george from the root group.
$ sudo usermod -G root george

Referance: https://www.networking-forums.com/programming-goodies-and-software-defined-networking/remove-a-user-from-the-specific-group-in-linux
#4
It is very easy just put the script file path after the ssh command like below.
ssh ismail@192.168.142.144 'bash -s' < cat myscript.sh
Look: https://www.networking-forums.com/programming-goodies-and-software-defined-networking/run-local-script-on-remote-system-via-ssh
#5
There are different functions and ways to match a word in PHP. Best way is using preg_match() function. In the following example we will search the forum word in the $bigtext content.
preg_match('/forum/',$bigtext)
Look: https://www.networking-forums.com/programming-goodies-and-software-defined-networking/match-for-a-word-in-a-text-with-the-php-script
#6
No. You shouldn't write a bash script. Just use the cp command bulk copy feature and provide all files you want to copy and add the path which is the destination. 
cp file1 file2 file3 /mnt/backup 
Referece: https://www.networking-forums.com/programming-goodies-and-software-defined-networking/copy-bulk-files-in-linux

#7
There are different ways. You can also use the systemd but as you are asking for init.d use the following command.
sudo /etc/init.d/networking start
Reference: https://www.networking-forums.com/programming-goodies-and-software-defined-networking/stop-network-service-with-init-d-for-ubuntu

#8
You can use the Python command to get the Python interpreter version. For the default Python installation use
python -v         
OR for Python2
  python2 -v
Or Python3
python3 -v           

Reference: https://www.networking-forums.com/programming-goodies-and-software-defined-networking/check-python-interpreter-version
#9
Python provides exists() function which can be used like below. Look https://www.networking-forums.com/programming-goodies-and-software-defined-networking/check-file-existing-with-python-script for more information. 

import os.path 

if(os.path.exists("/etc/passwd")): 

   print("/etc/passwd exists")