How To search for an string in a file using grep
grep searches the input files for lines containing a match to a given pattern list. When it finds a match in a line, it copies the line to standard output (by default), or does whatever other sort of output you have requested with options.
grep can simply be invoked: $ grep ‘STRING’ filename
Setting the Date and Time in Linux
Run the date command to make sure you have the correct time:
[root@server /root]# date
Thu Sep 20 11:00:06 CDT 2001
[root@server /root]#
If your timezone is correct but the date and/or time needs updating, the following commands will update the date and time. The second command is needed in order to push the date and time into the [...]
XMMS on Ubuntu
I’ve finally got new hdd for my laptop. So I decided to dedicate myself on getting to know more about Desktop version of Ubuntu. Latest copy was installed successfully without any troubles except driver for Nvidia. But that was easily solved by downloading and installing latest driver.
Linux file permissions
The basics of file ownership and permissions on Linux. Learn to understand who are the owners of a file or directory, how the file permissions work and how you can view them, and learn how to set basic file permissions yourself.
How to change a file’s owner and group in Linux
< chown – change the owner of a file >
You can change the owner and group of a file or a directory with the chown command. Please, keep in mind you can do this only if you are the root user or the owner of the file.
Set the file’s owner:
$ chown username somefile
After giving this [...]
Block root access to SSH service
SSH (Secure Shell) is a protocol for creating a secure connection between two computers.The secure SSH connection provides authentication and encryption. SSH also provides compression and is most common way for users and root to get connect to the server (Linux), the main reson behind blocking the root user is to allow the admin to [...]
Linux Filesystem Hierarchy
Here is a very cool and beautiful representation of the hierarchy which I found @linuxconfig.org site. The diagram below represents (part of) a Linux file system.
HowTo keep your Ubuntu up-to-date
It is important to have the system updated, so that we have all the latest patches, security fixes and packages upgrades from the repositories.
First, navigate to: System –> Administration –> Software Sources
and check that all repositories are enabled.
Then, open the terminal: Applications –> Accessories –> Terminal
and type: (you need to provide the password here)
sudo apt-get [...]
Limiting Access to Websites/Directories with .htaccess
This post is not so much a tutorial as my own notes on restricting access with .htaccess files and apache. As has been the case with many of my previous tutorials, the basis is writing the steps down so I can refer to them later. Turns out making notes public on a blog is a [...]
Configuring AWStats on Ubuntu Server
Last nite I sat down and configured AWStats on my Ubuntu 7.10 server. I had previously been using statcounter, a free stat service, but I had noticed that it was one of the causes of slowdown on my page loads. Having to access an external site and javascript wasn’t helping. I also run the server [...]
keep looking »