Archive for May, 2007



Published May 18th, 2007 by admin

Linux Commands – Permissions

This is Part 3 in a multi-part series. You can also view Part 1 and Part 2.

In Linux, more so than Windows, everything deals with and listens to file ownership and permissions. If a directory is set for only root access, only root can access it.

To change it to be any other way you must be root (or sudo).

Lets do just that. First let’s create a directory in the root called test:

sudo mkdir /test

and then:

sudo chown root test

This changes the owner of the test directory to root. Now if you try:

touch /test/test.txt

It will fail with a ‘permission denied’ error. That is because you are not root and root owns the directory.


Lets grab the group ownership of the directory for all users with:

sudo chgrp users test

We still can’t create a file inside (touch /test/test.txt) because by default the ‘group’ permissions on the directory only allow the access of files, not write capabilities. Let’s change that:

sudo chmod 775 test

This will allow both the owner and the group owner of the directory to read and write files while leaving all others with read only access.

The 755 is the confusing part to many. To break it down is rather simple. The first digit (7) is the access level of the owner of the file/directory. The second digit (7) is the access level of the group owner of the file and the last digit (5) is the access level for everyone else.

The breakdown of the numbers and their values is below:

no permissions — 0
execute only –x 1
write only -w- 2
write and execute -wx 3
read only r– 4
read and execute r-x 5
read and write rw- 6
read, write and execute rwx 7

r = read access

w = write access

x = execute access

That’s pretty much it. It is rather simple once you know how it works. Now you can secure all your directories and folders from the prying eyes of other users on your computer!

Technorati Tags: , , , ,

Published May 17th, 2007 by admin

Ubuntu and Automatix

We are going to take a break from the commands for a day and do something more fun…

What good is a fresh Ubuntu install if you can’t use it?

Well the fastest way to hit the ground running is by using Automatix. Their website gives instructions on how to install and once you do it opens the door to a lot of the “fun” tools in Ubuntu.

First off go ahead and install it.

Felt good, didn’t it? OK now run it by finding it in the Applications menu under System Tools. Go ahead and browse through the list of software and install anything and everything that interests you.


There is a lot of neat audio and video tools and applications in there to try out.

Go ahead try them all. In a future post I will show you how to get up and running the greatest, in my opinion, music player on any platform…

Until next time, remember to only sudo when you need to!

Technorati Tags: , , ,

Published May 16th, 2007 by admin

Linux Commands – Working with Files

In Part 1 of this multi part series we learned about transversing directories and viewing files from the Linux shell.

In this installment we will learn about working with files. Let’s go ahead and open up the terminal and type the following:

cd ~

This will take us to the home directory of the currently logged in user. Now type:

touch test.txt

This will create a blank text file named test. Now type:

mkdir test

This will create a directory in your home directory named test. (Type “ls” to see for yourself) Now lets move the test.txt file into the test directory:

mv test.txt test/test.txt

This tells Linux to move the test.txt file into the test directory inside of you home directory. You can also use the mv command to rename a file as so:

mv test.txt test1.txt

Now lets make a backup of the test.txt file:

cp test.txt text_backup.txt

This tells Linux to copy the test.txt file and name the copy test_backup.txt. Now let’s navigate back into your home directory using:

cd ..

This tells Linux to move up one directory level from where you currently are. Now if we would need to find the test.txt file we just made amongst other files you would type:

find test

That command will list all the files and their locations that meet the search criteria, “test” in this case.


Now let’s clean up the files and folder we made via:

cd test

and then:

rm test*

The above command will remove any file starting with test in the current directory. The “*” character acts as a wild card matching any character(s) that may follow “test”.

Now type:

cd ..

and finally:

rmdir test

The above command will remove the test directory that we created in the home directory.

This concludes part two, Working with Files. Thanks for visiting and tune in tomorrow for our next installment dealing with file ownership and permissions.

Technorati Tags: , ,

Published May 15th, 2007 by admin

Linux Commands – Working with Directories

As much as I hate to say it, there will be times in your Linux usage that you will need to use the command line or terminal as it’s called in the Linux world.

Don’t look at this as a bad or scary thing. The terminal is actually a great way to accomplish things very quickly compared to navigating via the graphical user interface (GUI).

To get you started in your terminal endeavors, I have listed some of the more common commands you will be using below.


Let’s start off easy. Once we have the terminal open, (Applications -> Accessories -> Terminal), type the following command:

ls

This will list all the files in the current working directory. What is the current working directory? Well that is the folder or directory on the system that you are currently viewing or working with. Want to find out the path to the current working directory you are viewing? Type:

pwd

Let’s navigate around a little bit now. Type the following:

cd /var/

This command will take us to the var directory in the root folder. Linux is organized a little bit differently than Windows. First of all there is no C, D, E, etc drive. Everything is organized under the “root” directory, simply called “the root directory”. This is written as “/”. Type the following:

cd /

This will take you to the root directory. An “ls” command will list all the folders and files in the root directory (your current working directory). To see more details about files in a directory such as date last modified and ownership permissions type the following:

ls -l

To show hidden files type:

ls -a

You can also combine these two to show the details of (all) hidden files:

ls -la

This is part 1 of a multi-part series. Stop by again tomorrow for part 2!

Technorati Tags: , , ,