APC Australia

Get to grips with Linux file navigation

Puzzled about structure? Nick Peers reveals how the Linux file system works, plus the best way to browse it using Ubuntu’s built-in file manager.

-

We’ve seen how Linux identifies the drives attached to your PC, and you’ve also discovered that Linux treats everything as a file — including folders (which is basically a file listing the files that make up that folder’s contents). But how are these files organised on your hard drive, and how do you access them through Ubuntu’s graphical file manager, Nautilus?

Let’s start with the raw basics. Linux organises files in a tree-like structure that’s a little bit similar to Windows, the major difference being that, while Windows physically separates drives into individual trees, with the drive letter at the top, Linux lumps everything together in a single file tree, with a top-level root (/) directory and everything else — including drives — placed relative to that directory.

This can sound confusing, but in actual fact, Linux provides a consistent, organised view of all the storage at your disposal. Once you understand where things are kept, it’s relatively straightfo­rward finding them again. And, actually, for day-today use, you’ll limit yourself to your personal user folder, which is always found inside the /home directory and is where your personal documents, photos, settings and other data is stored.

What makes things even easier to grasp is that Ubuntu ships with a user-friendly file manager in the form of Nautilus, which is accessible via the Files shortcut in the launcher. Nautilus will feel instantly familiar to anyone who’s used Windows own file manager, Windows Explorer, and shares many of the same characteri­stics.

Files and folders are represente­d by icons, and double-clicking one opens it. You can right-click for more options, while files can be deleted to the Recycle Bin or removed immediatel­y (select the file, hold Shift and press Delete) in exactly the same way. The annotation opposite reveals some of the key fundamenta­ls in using Nautilus to access and find files within the Linux file system.

WHAT LIES BENEATH

Let’s use Nautilus now to identify the key folders on your system, and find out what they’re for. Open it using the Files shortcut on the launcher and, by default, it’ll open to your personal home folder — /home/<username> — in the Linux file tree. Here, you’ll find familiar looking folders that mirror those found in other operating systems: they’re all self-explanator­y, aside perhaps from Public — a folder inside which you can store files that are accessible to others when they’re logged on with their own user profile — and Examples. This is simply a shortcut to a folder containing the Ubuntu Free Culture Showcase, which aims to provide free wallpaper, music and video.

Next, click the Computer shortcut in the left-hand navigation pane and you’ll be taken to the root directory where you’ll see a large number of folders. Not all of these need explaining, but of those that do, the / bin folder is where common programs shared by all users (including root and the system itself) are installed — this includes all Terminal programs. Startup files — including the Linux kernel are held under / boot, while we’ve already seen how /dev contains references to your system’s hardware including all attached storage devices.

The /etc folder contains many configurat­ion files, while the various /lib folders contain program configurat­ion data — similar to what’s held in the Windows Registry. External drives are mounted inside the /media folder, while /mnt serves as a ‘temporary’ mount point for devices like network folders.

The /root is the home directory for the root user. It’s kept away from the main /home folder in case of boot problems and can only be accessed via the ‘sudo’ command. Peek inside the /usr folder and you’ll find ‘ bin’ and ‘lib’ folders — this is where programs you install under your own user profile are kept. Finally, the /var folder contains variable data that includes potentiall­y helpful items such as logs for troublesho­oting problems.

This is all interestin­g, and useful to know, but it’s not something you should concern yourself with in day-to-day use.

EXPLORE NAUTILUS

Return to your home directory. Now roll your mouse up to the menu bar where you’ll see Nautilus has its own selection of menus. Browse these — File, Edit, View, Go, Bookmarks and Help — and you’ll see a list of familiarlo­oking commands, but some should

stand out. Start with ‘File > New Tab’, which allows you to have multiple locations open without cluttering up your desktop with windows. You’ll see the tabs appear above the folder pane and you can move (or copy by holding Ctrl as you click and drag) files between them by picking them up in one tab, dragging them over another tab and then waiting for that tab to open before dropping them.

Another handy tool can be found by choosing ‘Edit > Select Items Matching...’ From here, you can apply filters that ensure only particular files matching those filters (such as a file type — PNG, JPG and so on) are selected. While you’re exploring the Edit menu, select Preference­s to tweak Nautilus’ behaviour — of particular interest will be the Display tab where you can add extra descriptiv­e captions (such as file size or owner) under icons.

You’ll also notice a reference to zoom here — by default, up to three captions can be displayed underneath icons depending on how large you’ve magnified the icons. You’ll find these controls on the View menu, or you can use ‘Ctrl-Plus’, ‘Ctrl-Minus’ and Ctrl-0 to quickly adjust the zoom level.

HIDDEN FILES

By default, Ubuntu will hide any file that’s preceded with a period (.) mark — right-click a file in Nautilus and choose Rename to see how this works, then press Ctrl-R to refresh the view, when you’ll see it disappear. Don’t panic — select ‘View > Show Hidden Files’ and it’ll magically reappear, allowing you to rename it once again to remove the period mark and leave it permanentl­y in view.

Struggling to find a particular file? Click the magnifying glass button and a search bar will pop up. Simply enter your search terms and a list of matching files will appear — if you want to widen your search to your entire file system, click the ‘All Files’ button.

You can also apply file type filters to your search, to restrict results to documents, photos or whatever criteria you choose. Click the ‘+’ button, leave ‘File Type’ selected and then either pick a type from the drop-down menu (such as Illustrati­on, Spreadshee­t or Pdf/Postscript, or manually type a specific file extension (such as .png) to the filter. Nautilus supports multiple filters, so you could easily search for PNG, JPG and TIF photos without including GIF or other image types, for example.

 ??  ?? You won’t need to spend much — if any — time navigating the top level directory of Ubuntu’s file system.
You won’t need to spend much — if any — time navigating the top level directory of Ubuntu’s file system.
 ??  ?? Customise what gets shown underneath files when browsing in icon view — zoom into reveal more details.
Customise what gets shown underneath files when browsing in icon view — zoom into reveal more details.

Newspapers in English

Newspapers from Australia