Skip to main content

Posts

Showing posts from July, 2016

Searching files in Linux

Search the whole directory:     find / -name "php.ini" -print     find / -name "owncloud.conf" -print Using whereis command:      whereis php.ini From man whereis (command): NAME        whereis  -  locate the binary, source, and manual page files for a com-        mand Using locate command:     locate php.ini From man locate (command): NAME        locate - find files by name To find out more, type at terminal:     info locate     info whereis     locate --help     whereis --help Cheers..till next time. ================================ Free Android Apps: Click on links below to find out more: Linux Android App cheat sheet: https://play.google.com/store/apps/details?id=com.LinuxMobileKit Multiplication Table for early learners https://play.google.com/store/apps/details?id=com.TableMultiplication https://play.google.com/store/apps/details?id=soulrefresh.beautiful.prayer Catholic Rosary Guide  for Android : https

Linux Awk insert text at specific line number

One liner command for Awk to insert a new string or text at a specific line number on a file. awk 'NR==3{print "new line text at row 3"}1' original_file.txt > modified_file.txt 'NR==3 --insert string or data at line number 3 "}1' -- number 1 (can be any number) means to append the new text or string > modified_file.txt -- redirect the output to a new file To find out more, type this at the terminal.                 info awk                 info print                 man awk                 man print Or you can redirect the output of info and man to a file for offline viewing. Check out links below for other examples of awk command. http://quickbytesstuff.blogspot.sg/2016/02/linux-awk-simple-example.html http://quickbytesstuff.blogspot.sg/2016/05/basic-awk-usage-tutorial.html ================= Catholic Rosary Guide  for Android: Pray the Rosary every day, countless blessings will be showered upon your life if

Centos Samba failed to add user

Adding Samba users to Linux Centos box or other Linux distro fails.  If a user account name, added to Samba does not have an account on the Linux box, then creation of the Samba user account will fail. So before adding user accounts to Samba, create an account for the user on the Linux box. Do these steps below: Adduser account to Linux: 1. adduser  'user_name' --- create a user account     adduser --system --no-create-home user_name man adduser - for more info adduser --help adduser --info  apropos adduser You may need to add sudo before the command if you're running Ubuntu. Or check the documentation of your Linux distro on how to add user account. Now that a user account has been created, add the user account to Samba.  2. smbpasswd -a user_name   (the user name that was created on Step 1) man smbpasswd - for more info smbpasswd --help smbpasswd --info apropos smbpasswd If everything goes well, then creatio

Tools for Linux Troubleshooting

A basic troubleshooting skill is just necessary for a System Administrator. One way or another thing will go south, no matter how you make sure that the system is working perfectly healthy. Patches, updates, new security holes or vulnerabilities will definitely change the whole system and if something goes wrong, then a working system will need troubleshooting. Even new system configuration changes that are not recorded and left forgotten and cause an adverse effect that is applied to the system will cause chaos and more time will be spent in troubleshooting, only to find out that a minor change causes the whole thing. Here are some tools below, which could provide a basic troubleshooting to a Linux system. A general purpose logs files, which shows messages from the system.                  tail -f /var/log/messages /var/log/  -- directories which contains log files for the system. This directory can easily fill up the space of the whole system if not the lo