An Introduction to Linux Basics
About LinuxLinux is a free, open-source operating system. All of ASPHostPortal's offered operating systems are Linux distributions.
Linux has been under active development since 1991. It has developed to become versatile and used all over the world, from web servers to cellphones.
ASPHostPortal offers Linux distributions on server instance's because Linux is free and easy to use.
However, newcomers to Linux may find it difficult to approach the structure of an unfamiliar operating system.
This guide gently introduces key terminal skills and equips newcomers to learn more about Linux.
The TerminalFor most of the time when you access a server, you'll be doing it through a terminal shell. The shell allows you to execute commands on the server instance.
All administrative tasks can be accomplished through the terminal. This includes file manipulation, package installation, and user management.
The terminal is interactive. You specify commands to run. The terminal outputs the results of those commands. Executing any command is done by typing it and pressing Enter.
NavigationLinux filesystems are based on a directory tree. This means that you can create directories (or "folders") inside other directories, and files can exist in any directory.
To see what directory you are currently active in:
This stands for "print working directory", and will print the path to your current directory. The output can look similar to this:
This means that your current active directory is foo, which is inside home, which lives in the root directory, /.
To see other files and directories that exist in your current working directory:
This will give you a list of names of files and directories. To navigate into a directory, use its name:
This will change your new current working directory to the directory you specified. You can see this with
Additionally, you can specify
We can also create new directories in our current working directory. For example, to create a new directory called bar:
Then we can
File ManipulationFiles cannot be used with
Instead, we can view files. If we have a file baz in our current directory:
This will print out the entire contents of baz to the terminal.
With long files, this is impractical and unreadable. To paginate the output:
This will also print the contents of baz, but one terminal page at a time, beginning at the start of the file.
Use the spacebar to advance a page, or the arrow keys to go up and down one line at a time. Press q to quit out of
To create a new file called foobar:
This creates an empty file with the name foobar in your current working directory. The contents of this file are empty.
If we decide foobar isn't such a good name after all, we can rename foobar to fizzbuzz:
By specifying the original file, we can "move" it to a new location in the current working directory, thereby renaming it.
It is also possible to copy a file to a new location. If we want to bring back foobar, but keep fizzbuzz too:
Just as you guessed,
However, what good is a file if it contains nothing? To edit files, a file editor is necessary.
There are many options for file editors, all created by professionals for daily use. Such editors include vim, emacs, nano, and pico.
nano is a perfectly suitable option for beginners. It is easy and simple to use, with no bells or whistles to confuse the average user.
To edit text into foobar:
This will open up a space where you can immediately start typing to edit foobar.
To save the written text, press
Now foobar has some text to view when using
Finally, to delete the empty fizzbuzz:
Unlike directories, files are deleted whether they contain content or not.
The Filesystem Hierarchy StandardNearly all Linux distributions are compliant with a universal standard for filesystem directory structure.
The FHS defines clearly determined directores for different purposes.
The symbol / is used to indicate the root directory in the filesystem hierarchy defined by the FHS.
When a user logs into the shell, they'll be brought to their own user directory in /home.
The FHS defines /home as containing the home directories for regular users. (root has its own home directory in /root, also specified by the FHS.)
Because default, common-sense locations are provided for many different kinds of files, organisation of files for different purposes is simplified.
PermissionsOn a system with multiple user accounts, determining who is allowed to interact with what files is important.
Linux supports unix-style filesystem permissions, which restricts who can read and write certain files.
Permissions are an expansive and profound topic, discussed in detail in our permissions article.
A Culture of LearningSo far, this guide only serves to teach the basics of toddling around in a Linux environment. But knowing your way around the Linux environment requires a mindset of study and illumination.
When you have a question about how to accomplish a task, there are several avenues of instruction you can turn to.
First and foremost, Google and DuckDuckGo are invaluable resources. Odds are that if you have a question, many others have already asked it and had the question answered.
Your immediate instinct should be to look for the answer through those search engines.
When your question has to do with any Linux command, the manual pages offer detailed and insightful documentation for nearly every single command.
To see the man-pages for any command:
Gaining the information you seek is an essential skill, which will sustain your Linux career for as long as you stay devoted to a time of learning.
|Posted by: ASPHostServer Administrator - Fri, Dec 27, 2013 at 2:05 AM. This article has been viewed 1676 times.|
|Online URL: http://faq.asphosthelpdesk.com/article.php?id=205|