Common Linux Configuration Files
Every user who switches from Windows to Linux has the fear of editing configuration files using the command line interface (CLI). If you are one of those people, then I am here to guide you through the most common configuration files found in a Linux system. Please note that to be able to edit these files, you need to have knowledge in file editors such as vim or pico.
/etc/profile
System wide environment variables for all users.
/etc/fstab
List of devices and their associated mount points. Edit this file to add cdroms, DOS partitions and floppy drives at startup.
/etc/motd
Message of the day broadcast to all users at login.
/etc/rc.d/rc.local
Bash script that is executed at the end of login process. Similar to autoexec.bat in DOS.
/etc/hostname
Contains full hostname including domain.
/etc/cron.*
There are 4 directories that automatically execute all scripts within the directory at intervals of hour, day, week or month.
/etc/hosts
A list of all know host names and IP addresses on the machine.
/etc/httpd/conf
Parameters for the Apache web server
/etc/inittab
Specifies the run level that the machine should boot into.
/etc/resolv.conf
Defines IP addresses of DNS servers.
Linux Shortcuts Every Newbie Should Know
Linux Shortcuts Every Newbie Should Know
One thing that Linux is not so popular of is that it has quite a few keyboard shortcuts that every Linux user should know. Here are a few examples of Linux shortcuts that will help anyone who uses Linux.
<Ctrl><Alt><F1>
Switch to the first text terminal. Under Linux you can have several (6 in standard setup) terminals opened at the same time.
<Ctrl><Alt><Fn> (n=1..6)
Switch to the nth text terminal.
tty
Print the name of the terminal in which you are typing this command.
<Ctrl><Alt><F7>
Switch to the first GUI terminal (if X-windows is running on this terminal).
<Ctrl><Alt><Fn> (n=7..12)
Switch to the nth GUI terminal (if a GUI terminal is running on screen n-1). By default, nothing is running on terminals 8 to 12, but you can run another server there.
<Tab>
(In a text terminal) Autocomplete the command if there is only one option, or else show all the available options.
<ArrowUp>
Scroll and edit the command history. Press <Enter> to execute.
<Shift><PgUp>
Scroll terminal output up. Work also at the login prompt, so you can scroll through your bootup messages.
<Shift><PgDown>
Scroll terminal output down.
<Ctrl><Alt><+>
(in X-windows) Change to the next X-server resolution (if you set up the X-server to more than one resolution). For multiple resolutions on my standard SVGA card/monitor, I have the following line in the file /etc/X11/XF86Config (the first resolution starts on default, the largest determines the size of the “virtual screen”):
Modes “1024×768″ “800×600″ “640×480″ “512×384″ “480×300″ “400×300″ “1152×864″
<Ctrl><Alt><->
(in X-windows) Change to the previous X-server resolution.
<Ctrl><Alt><BkSpc>
(in X-windows) Kill the current X-windows server. Use if the X-windows server crushes and cannot be exited normally.
<Ctrl><Alt><Del>
Shut down the system and reboot. This is the normal shutdown command for a user at the text-mode console. Don’t just press the “reset” button for shutdown!
<Ctrl>c
Kill the current process (mostly in the text mode for small applications).
<Ctrl>d
Log out from the current terminal. See also the next command.
<Ctrl>d
Send [End-of-File] to the current process. Don’t press it twice else you also log out (see the previous command).
How to Fix the Terminal After Viewing Binary File
Every now and then, I open up a file only to realize that it is a binary file (yes, I keep ignoring the warning that I am about to view a binary file, not text). Then the terminal ends up messy, or in other words, wonky. The characters have turned out in various colors, the lines are indented, and you can’t see what you are typing.
To fix it, run this command:
$ reset
As the name implies, this will reset the terminal back to its normal state.
How To Reset MySQL Password
If you are like me who tend to forget passwords almost every time, then this tip might help you reset your MySQL password just in case.
To begin, you must have access to the server, one that can stop and start the MySQL process, such as a root account. Sudo account can also be used, just as long that the user can control the MySQL service.
Begin the process by stopping the MySQL process. This can be done by executing /etc/init.d/mysqld stop command, but this can vary depending on how you setup your server. Also, be careful of users who might be using the MySQL service as stopping the service might disrupt their work.
Once the MySQL process is killed, execute the following command:
mysqld-safe --skip-grant-tables
This will run the MySQL process so you need to open another terminal to be able to reset the password. On the new terminal, you will now be able to login to MySQL to reset the password.
On the shell prompt of the new terminal, open the MySQL console:
mysql
mysql> use mysql;
mysql> UPDATE user SET Password=PASSWORD(‘YOUR_NEW_PASSWORD’) WHERE Host=’localhost’ AND User=’root’;
mysql> exit
This will change the password for the user ‘root’. Kill the MySQL process running in the first terminal, either by killing the PID or executing CTRL+C. Then start the process again, this time with the proper procedure:
/etc/init.d/mysqld start
Try logging in to the MySQL console using the new password:
mysql –uroot -p
You should now be able to use the new password for your MySQL.
Search PinoyTux
Subscribe to Email Feeds
Blog Lounge
Popular Posts
Recent Posts
Drop your Card Here
Recent Comments
- Mela
on Cebu Pacific Sucks - madcSPYnX
on AMA Desktop: Linux Made in Philippines - David Fortier
on Cebu Pacific Sucks - David Fortier
on Cebu Pacific Sucks - Mr. Walkman
on Shopping for Mobile Phone: Sony Ericsson Phones Only








