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):
       whereis  -  locate the binary, source, and manual page files for a com-

Using locate command:

locate php.ini

From man locate (command):
       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:
Multiplication Table for early learners
Catholic Rosary Guide  for Android:

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.

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.