When I was new to Linux, one of the first things I wanted to do was to take a look at the filesystem. To do that from the command line, I had to acquire a bit of an understanding of how a Linux or Unix filesystem is set up, and learn a little bit about the cd and ls commands.
Another approach, of course, is to simply use a GUI (graphical user interface) file browser like Konqueror to take a look at things. We'll take a quick look at both approaches.
In Mepis 8.0, whether I open a terminal or Konqueror, the starting point for either one is my /home/steve directory. In the terminal, I'll see this command prompt:
steve[~]$
This prompt is showing my username ("steve") and the current directory ("~" indicates my "home" directory, /home/steve). The "$" indicates that I'm operating as a "normal" user; if I was operating as the "root" (adminstrative) user, I'd see a "#" symbol.
By comparison, I can open up Konqueror, which will also start me off in my /home/steve directory. Here's how it looks (remember, you can click on any of these images for a larger view; or, in Firefox, right-click on the image and select Open Link in New Tab or Open Link in New Window):
At the left, I have the "Root Folder" view showing, with all of the directories under "/" visible. At the right is everything inside my /home/steve directory. Above, the location bar shows the current directory. I can click on any of the items in either list to move around and view the contents of a directory or file. I can also type in something in the location bar to move around.
If I want to use the terminal to move around and view things, I have to make use of the cd and ls commands. The cd command means "change directory" and the ls command lists whats in the current directory.
Over in the terminal, if I want to see the contents of my /home/steve directory, I can simply type ls and press enter, and this is what I'll see:
The terminal is showing me the same items that Konqueror shows.
The ls command has many options. You can find out about all the things you can do with ls by looking at its manpage -- type man ls. To exit the manpage, simply type q and you'll be brought back to the command prompt.
For example, the -l trigger gives you a "long listing format" instead of the view seen above:
Now, let's say I want to view a different directory -- the /boot/grub directory, for example. In Konqueror, I can just go to the left panel and click on the "boot" icon, then click on the "grub" icon, and I'll see something like this:
Now I can see the contents of the /boot/grub directory.
To do the same thing from the terminal, I need to move into the /boot/grub directory by typing cd /boot/grub. Then I can view the contents of /boot/grub by typing a ls command. In this case, I'll use ls -l again:
Again, I can see the same directories and files in the terminal that I could see in Konqueror.
Konqueror has a very nice feature called "Show Terminal Emulator" that opens up a terminal right inside Konqueror. It's very helpful to a new user because it lets you see what the terminal commands might be corresponding to what you're doing in Konqueror.
For example, when I start in my /home/steve directory in Konqueror and click on the "boot" icon and then the "grub" icon to move into the /boot/grub directory, the terminal emulator at the bottom shows the corresponding terminal commands for doing the same thing:
I can then type commands right in the terminal emulator just like I could inside of a normal terminal. Here I'll use the ls command again to get a listing of the contents of /boot/grub.
Sometimes I prefer to use Konqueror for file browsing; other times, it's easier to do it from the terminal. And often, I want to use the terminal emulator inside of Konqueror to see both views, so that I can compare things and see what commands are being used.
Either way, browsing around the Linux filesystem isn't all that difficult. It's helpful to know how to do it both ways.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment