Tag: cd

gnuBy Rand Whitehall

In the Linux command line shell, moving around from directory to directory, adding new directories, and deleting old directories is easy once you know the proper commands. Again, with Linux, you are limited only by your brain! If you know all the commands, then you weild great power. But if you know only a few commands, it’s like you are standing in the airport in Tokyo and want to know where the bathroom is, but only know how to say hi and bye in Japanese.

Let’s get to it. Open a shell (or terminal) and type each line below followed by enter:

cd

pwd

You should be in your home directory, which is the same name as your username. So if your username is barney22, your home directory should be /home/barney22.

Now, let’s create a new directory to play with. (Remember, when learning the command line in Linux, always play with new directories and files you create to practice with. Never practice with important files and directories.) Type this:

mkdir doggy [enter]

ls [enter]

Now you should see your new directory called doggy in the ls output. Great! Now what? Let’s change the name. Type:

mv doggy doggyDo [enter]

ls [enter]

And you should see the directory name has been changed from doggy to doggyDo. Great! Hmmm… Now let’s go into the doggyDo directory and create a text file.

cd doggyDo [enter]

touch shibaken.txt [enter]

ls [enter]

Now, you should be in your doggyDo directory and see the new text file you created with the touch command. If for some reason you got lost somewhere along the line, go “home” by typing this:

cd [enter]

A cd command with no destination will take you home every time.

Now, let’s say you want to move the doggyDo directory into another directory. Let’s create another directory first, like this:

cd [enter]

mkdir doggyDocs [enter]

Now let’s move the doggyDo directory into the doggyDocs directory like this:

mv doggyDo doggyDocs [enter]

ls [enter]

You should see the doggyDocs directory now, but not the doggyDo directory because it is inside doggyDocs.

cd doggyDocs [enter]

ls [enter]

You should see your doggyDo directory there inside doggyDocs.

I hope you learned a lot about creating and moving directories around in the Linux command line. If this was a bit confusing, then just go through it again slowly. With a little practice your fingers will know what to do as soon as you think of it!

Rand writes about web design, Linux, men’s health and more. Please check out his DE safety razor site for shaving info and tips and the latest on the Merkur Futur safety razor. It’s a great resource for those who are passionate about a quality, close shave.

Tags: , , , , , ,

By Christopher P Wakefield

This time we are going to have a look at Linux permissions. Every current operating system deals with permissions, whether it is ownership of a file or just gaining read access to a folder. As with everything else in Linux there are command line tools and the graphical user interface so we shall discuss both.

chown --helpThe Chown Utility

This is a command line tool that deals with the ownership of a file or folder. Open up a terminal and switch to root. Navigate to the directory which contains the file / folder you want to change and type:

chown [username][file /folder]

So for example if I wanted to change the owner of a file called tools to natasha and it was located in /home/chris I would type:

cd /home/chris

chown natasha tools

To check who owns a particular file / folder you can navigate to the directory that contains the file / folder and type:

ls -l

The Chmod Utility

Next up is the chmod utility which deals with permissions themselves. Open up a terminal and switch to root. Navigate to the directory which contains the file / folder you want to change and type:

chmod [777][file / folder]

Lets first explain the numbering system above. There are three types of permissions in Linux – Read, Write and Execute which are given values of 4, 2 and 1 respectively. So in the syntax above the file would be given Read (4), Write (2) and Execute (1) permissions (4+2+1 = 7). But don’t you give permissions to people and not files or folders? Correct, that is why there are three numbers which represent the owner, group and others. Lets take an example to illustrate the point. Say I wanted to change the permissions of a file called tools.doc to owner (rwe), group (rw) and others (r) and it was located in /home/chris I would type:

cd /home/chris

chmod 764 tools.doc

This gives the owner (rwe = 7) group (rw = 6) and others (r=4) different levels of access to the file.

Graphical Means of Changing Permissions and Ownership

For people who don’t want to use the command line there is another way to do all this. I shall illustrate this using Linux Mint 9. Locate the file you want to alter by using your file manager. Right click and go to open as root. In Linux Mint 9 the background will go red when a file is open as root. Right click and go to properties. On the properties page you will be given the option of changing permissions for the owner, group and others along with changing the owner of the file. Change accordingly.

Hi I am Chris the owner of ComTech. I provide IT support to both personal and business clients from my base in Alloa, Clacknmannanshire. Here at ComTech I am experienced in using Windows, Linux and Cisco technologies whether it be for the home or business. I also incorporate Blackberry hardware into my business, namely the Blackberry Playbook and Bold 9780. I can advise, design and implement solutions to any problems you may have so if you have IT issues just pick up the phone. Please go to http://www.comtech247.net for more information.

Tags: , , , , ,

Important Unix Commands That You Should Know

By Bernard Peh

Unix is one of the most important operating system today. Its powerful features, scalability, strong security, and support for multiple users have made it the top choice operating systems for server, workstations and mainframes.

It is good to have some knowledge of Unix commands especially if your web host is Unix/Linux based. You could do alot of things by yourself by logging into the server via Secure Shell(SSH). This article will describe some of the important “need to know” Unix commands.

1. ls

This command will show you what files are in your current directory. If you add in a -F option, ie “ls -F xxx”, there will be a “/” appended to the end of directory names, * to executables and @ to links. “ls -a xxx” will display all hidden files as well. This is also the most used command.

2. cd

Change directory. If you type “cd xx”, it means to change to the specified directory “xx”. “cd ~” means to change to your default home directory.

3. cp “a b”

Copy file a to b. If b is a directory, the new file will be named b/a.

4. mv “a b”

Move files from a to b. For example, if I type “mv songs.txt /tmp”, the file songs.txt will be moved to /tmp/songs.txt. Moving a file is the same as renaming a file.

5. echo “text”

Print “text” to the terminal. If “text” is surrounded by double quotes, the text will be printed with any environment variables such as $HOME. If “text” is surrounded by single quotes, the “text” is printed without any special processing.

6. pwd

Print the current working directory. Useful command when you are lost in the directories.

7. cat “file”

Print the contents of the specified file(s) to the terminal.

8. less “file”

Display the specified file one screen at a time. Press the spacebar to go to the next screen. Press Q to quit. You often combine “less” with some other commands such as “cat abc | less”. This command means you print the contents of the file abc and display it one page at a time.

9. ps

Display information about your running programs. This is a good command to use if your server is slow and you suspect that some applications are taking too much memory. The most famous command using ps is “ps aux”. This will display useful information on the running programs.

10. rm

Remove or delete a file. If you type “rm -r directory”, it will remove a directory and all the files underneath it recursively.

11. man

This is the most important command. man means “manual”. If you are stuck with cat command for example, type “man cat” and you can see the help file.

Bernard Peh is a great passioner of web technologies and one of the co-founders of SiteCritic Website Reviews. He works with experienced web designers and developers for more than 5 years, developing and designing commercial and non-commercial websites. During his free time, he does website reviews,freelance SEO and PHP work.

Tags: , , , , , , , , , , ,

Linux Training – Linux Installation Help – Linux Live CDs & Linux Installation CDs – Pros and Cons

By Clyde E. Boom

You get real, practical Linux training when you get Linux running on a computer system, and you work with it to get experience.

Once you get the Linux OS (operating system) running, you can learn how to use Linux desktops, run Linux software programs, and most importantly, go to the Linux command line to run Linux commands – the real power behind Linux system administration.

Two popular methods of getting to work with the Linux OS are:

1. Install Linux from CD or DVD onto the hard disk in a system

2. Boot and run Linux from Linux live CDs or DVDs (without installing Linux)

Here are some of the pros and cons of installing Linux on a system and running Linux from a live CD or DVD.

Linux Live CDs – Pros

1. The Linux OS boots and runs in just a few minutes entirely from a single Linux live CD (or DVD).

2. A lengthy Linux installation is not required. You don’t need to provide a lot of settings to the Linux installation routine and then wait while the Linux OS and Linux software programs are copied onto the hard disk.

Also, if you install Linux on Windows, you need to back up your system before you do and you may damage your Windows setup during the Linux installation – or if you remove Linux later!

3. You only need to get 1 Linux live CD or DVD, as opposed to possibly needing several when you install Linux. Therefore, if you download Linux to burn a Linux ISO file to CD / DVD, you only need to wait while 1 Linux CD / DVD is downloaded.

4. Linux live CDs / DVDs are very inexpensive. If you don’t want to download Linux as a live CD / DVD, you can order one and have it mailed to any location on the planet for a very small amount of money. Just run your browser and do a search for “list of linux cds” or “list of linux dvds”.

Linux Tips: If you are going to buy a Linux live version and you have a DVD drive, get a Linux live DVD rather than a CD. A DVD holds about six times as much as a CD. Therefore, you’ll get lots (and lots) more Linux software programs on a DVD!

5. A Linux live CD can easily be removed and taken anywhere. Portable Linux!

6. You can save your work (data files) – if you get the right Linux live CD or DVD.

Linux Tips: Before getting a Linux live CD / DVD, do some research to make sure you can save your work. Some Linux live distros let you save your data and some don’t. For example, the Ubuntu Linux live CD allows you to save your work to a USB flash drive.

Linux Live CDs – Cons

1. Although booting from a Linux live CD / DVD is faster than doing a complete Linux installation, you still need to wait while your system boots from the live CD / DVD, every time your system starts. If you usually keep your system turned on, this isn’t an issue.

2. You may not be able to save your work. Some Linux live CD / DVD distros allow you to save your work and some don’t.

3. You need to boot from the Linux live CD / DVD every time your system starts. This may not be very convenient if you need to put other CDs or DVDs in the drive while running Linux “live”. Any time you need to put something in your drive, you have to remove the live CD / DVD. This also increases the likelihood that your live CD or DVD will become damaged.

Linux Tips: Keep a copy of your current Linux live CD handy in case your working copy becomes damaged.

Either way, installing Linux or using Linux live CDs (or Linux live DVDs), is an excellent way to get Linux training so you can learn how to use Linux.

Clyde Boom, Author and Expert Trainer with 20+ Years of Training Successes. Explains intricate technical matters in an easy-to- understand, non-technical manner, with tens of thousands of software and hardware learners into masters.

You can watch Free Sample I Learn Linux Video Tutorials at http://www.iLearnLinux.com and get over the steep Linux learning curve.

Sign up for Free I Learn Linux News to receive technical tips, info on new video samples and important updates on Linux.

You need to learn Linux the easy way to get that new job, qualify for that next promotion, earn a hefty raise, get Linux certification, or keep your current job because your company is trying to save on software licensing fees (eza). Watch, do, and learn!

Tags: ,

The Best Linux Operating System – Some Important Things to Consider

By Richard S. Corbin

Linux is starting to catch the eyes of many, many people who normally wouldn’t go there! Finding the best Linux operating system is not hard at all. I want, in this article, to point out a few things that I’ve learned since starting to use the Linux system 4 or 5 years ago.

  • There are many, many Linux Operating systems.
  • You can download and try as many as you like without paying a dime.
  • There are some really, really great ones that are better than the top systems for sale out in the marketplace.
  • There are some that are very, very simplistic and basic.
  • There are some that are more graphics driven and elaborate.
  • The online support for Linux is second to none. If you have a question, there are many, many resources to choose from and you can leave your credit card in your pocket because they’re free.
  • You can try the Linux operating system from a CD and not even disturb the system your now using.
  • To narrow it down, I tried the top ten Linux distributions and made a decision from there.
  • All of the distributions of Linux include so much software that there is something for everyone.
  • One of the coolest things is that you can just go to the Linux site of your choice and download it. Then you just burn it to a CD and your ready to go.

It seems funny, but there is a certain sense of accomplishment when you download and use Linux for the first time. Computers are such a big part of our lives now and usually you just buy one and are told what to do by the operating system on your machine. Using Linux tends to make you feel more in charge.

No Viruses or crashes!! I have never had to use any anti-virus software since switching to Linux years ago! Isn’t that amazing! I was always so concerned before about viruses and Spam and spy ware and on and on… I have never had an attack since using Linux. In the past I had spent so much money on getting my computer cleaned up by computer repair shops, that it was maddening. A friend set Linux up for me and I’ve never used anything else. He even set it up for his elderly parents and they have been using it longer than me.

The bottom line is, try one of the top rated versions of Linux for yourself and see what you think. I’m not going to mention the names of the ones I’ve tried or the one that I settled for, simply because it is totally up to you and for you. You will develop your own preferences for the different software etc. and I’m sure that you will be very impressed with Linux whatever version you use. And don’t worry, if you don’t like the first one you use, just try another version. Usually a person settles on one brand and sticks with it.

Now, go try the Linux operating system for yourself and have some fun and freedom.

At the following site you can see a comparison of Windows software to Linux software. There is also a free gift. http://www.linuxez.info.

Tags: ,
Back to top