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://play.google.com/store/apps/details?id=com.myrosaryapp
http://quickbytesstuff.blogspot…

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

Centos Samba failed to add user

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 log files are not managed properly.
/etc/rsy…