How To Customize The Linux Shell?

The shell provides a variety of mechanisms for the creation of individual working conditions. The shell ? – is more than a shell. The linux shell is also a powerful programming language. Method scripting shell ? – separate big topic, here we give only a few ways you can use to bring advanced capabilities to shell to facilitate the work in the system Linux.

When executing scripts different shells use different syntax. For example, the shell tcsh uses a syntax similar to the programming language C, while the shell bash uses the syntax of another type. In this section, these differences are not very significant, but still assumed that the shell scripts are executed bash.

The Linux shell scripts

Suppose that you often have to perform a sequence of linux shell commands, and you want to save time entering commands, grouping them into one team. For example, to concatenate files chapter1, chapter2 and chapter3 in a file named book, issue number of rows and print the file will be used in a sequence of three commands:

/ Home / larry# Cat chapter1 chapter2 chapter3 $> $ book
/ Home / larry# Wc-l book / home / larry # lp book

Rather than enter these three commands from the keyboard, you can combine them in Shell script. Script that will execute these three teams will look like this:

#! / Bin / sh
# Script to create and print books cat chapter1
chapter2 chapter3> book wc -l book lp book

The shell scripts are plain text files, they can create a text editor such as emacs or vi.

Consider this script. The first line #! / Bin / sh identifies this file as a script and tells the shell how to execute. This line tells the shell that this file should be transferred to the execution of the program / Bin / sh, Ie, the shell program itself. This line is important because in most systems Linux file / Bin / sh contains a shell-type bash. For example, bash and the string is forced to work in the shell executes the script using the syntax adopted in the shell bash (Rather than the syntax based on language C, for example). Even if, as start shell (Login shell) is used tcsh with this line, this script will execute the shell bash.

The second line is commentary (Comment). Comments start symbol # and continue until the end of the line. The shell ignores the comment. Usually the comments are used to indicate the purpose of the script and make it more understandable.

The remaining line of the script are the usual commands, such as if they were injected directly working with the shell. The shell reads each line of the script and executes it the same way as if the input line of the shell prompt.

Scripts are essential access rights. If you create a shell script, you need to ensure that you have the right to its execution. When you create text files, usually by default the right to execute the file is not given, and this right should be assigned to files explicitly. Installation and change the permissions discussed in detail above. For brevity, we indicate that in this case, if the script is written to a file makebook, you can use:

/ Home / larry# Chmod u + x makebook

This command will give you the right to execute script in a file makebook.

Now, to execute all the commands the script, only one team:

/ Home / larry# Makebook

Posted under Linux Tutorials

This post was written by Admin on October 8, 2010

Tags: , , , ,

Brief Explanation About Colocation Hosting

Colocation – It is a special type of hosting much similar to dedicated hosting, in which the client places their own server hardware in the fully equipped data center.

Many experts are inclined to consider colocation of individual services, rather than the type of hosting, because it is more like rent physical space.

The client server is placed in a data center by the web host. Mounted in a special racks and connects to the Internet channels of high speed and bandwidth. Not necessarily the client must bring a physical server, they may be separate components – processor, memory and so on. Often the client also rents equipment at the provider.

The data center is a separate building, which contains lot of servers. Each server is supported by the relevant department of the temperature and climatic conditions, protection against fires, failures in power, physical security, etc. Everyday, data center experts monitor equipment failures and operational efficiency.

Special services for servers, data protection, data backup is usually performed for a fee and not included in the standard set of services.

Colocation is not used for simple data storage or websites. Usually, its users are more than simple hosting services providers, which thus saving on the “last mile”. Also put on the colocation super-server, telephony gateways, mobile operators, telegraph, hubs.

Prices for colocation services vary considerably depending on the power of data center network connectivity speed, the reliability of the protection of the server room.

Often mistakenly called colocation services to the dedicated servers. This is totally wrong. Colocation is in a different of hosting services and could not be counted in typical web hosting types.

Posted under Dedicated Servers

This post was written by Admin on June 1, 2010

Tags: ,

Steps To Create Users on Linux Dedicated Server

Truly speaking, the customers does not require to add new websites users from the command line on their uk dedicated servers with the help of control panel. Many of the control panels will automatically set up the users and groups, whenever a new website is created. Once, there was a time when the clients use to create the users and groups manually.

However, because of the automation people are now easily able to reduce their work load.

For example, if you want to install a specific software, such as a complicated Perl application, it may require its own user and user group. You may also require to assign different privileges to those users.

Another example is that, imagine you are using your uk dedicated servers for something other than website hosting and don’t have a web based control panel. It might be anything, may be a game server or a chat server, and adding different control panels will only consume the system resources that you require elsewhere.

To add a user, go through the below steps:

1. Login to your server via SSH

2. Become root:

su

3. As an example, let’s say you want to make a user called “gamerdude” with a group by the same name (default setting). Type this from the command line:

adduser gamerdude

4. When it asks for a password, enter the user’s password

5. It will ask for other information like “phone number.” This is optional.

6. If all of the information is correct, press “y” yes.

Sample output:

# adduser testman3
Adding user `testman3′ …
Adding new group `testman3′ (1004) …
Adding new user `testman3′ (1004) with group `testman3′ …
Creating home directory `/home/testman3′ …
Copying files from `/etc/skel’ …
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for testman3
Enter the new value, or press ENTER for the default
Full Name []: Test Man
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] Y

To assign file ownership to the new user, use the following command:

chown gamerdude:gamerdude /var/www/files/filename

To assign ownership of an entire directory, enter:

chown -R gamerdude:gamerdude /var/www/files

Posted under Dedicated Servers

This post was written by Admin on April 28, 2010

Tags: ,