Header Ads

Breaking News

Tricks for getting around your Linux file system

Whether you’re moving around the file system, looking for files or trying to move into important directories, Linux can provide a lot of help. In this post, we’ll look at a number of tricks to make moving around the file system and both finding and using commands that you need a little easier.

Adding to your $PATH

One of the easiest and most useful ways to ensure that you don’t have to invest a lot of time into finding commands on a Linux system is to add the proper directories to your $PATH variable. The order of directories that you add to your $PATH variable is, however, very important. They determine the order in which the system will look through the directories to find the command to run — stopping when it finds the first match.

You might, for example, want to put your home directory first so that, if you create a script that has the same name as some other executable, it will be the one that you end up running whenever you type its name.

To add your home directory to your $PATH variable, you could do this:

$ export PATH=~:$PATH

The ~ character represents your home directory.

If you keep your scripts in your bin directory, this would work for you:

Copyright © 2020 IDG Communications, Inc.

Source link

No comments