Unix can be learned quickly with this basic Unix tutorial. This tutorial works for all variants of Unix including Linux, Solaris, BSD, and HP-UX.
Although Unix can seem overwhelming, it is possible to learn Unix quickly by mastering a few simple commands. For the purposes of using this Unix tutorial, it does not matter which distribution or Unix variant you are using. Everything from Linux, BSD, Solaris, and HP-UX will work.
Although there are important differences between each Unix operating system, they won't be too noticeable to somebody who is just learning a few Unix commands. If you are used to the MS-DOS command line, this tutorial should be very easy since both command lines are similar.
The first thing that needs to be done is to install Unix on your computer. In almost all cases, there is an easy-to-use graphical installation option available. After you are done installing Unix, begin by logging in to the system. It is recommended that you don't log in as root, which is the administrator account, because you can do a lot of damage with that account. However, this tutorial will work fine when logged in as root.
How to Use Unix File Systems
Think of a Unix file system as a tree with an upside down root at the top. It branches out into subdirectories which in turn have more subdirectories. Below are the commands you will need to navigate a Unix file system.
Enter a directory called directory1.
cd directory1
Enter directory2, which is underneath directory1.
cd directory1/directory2
Enter the directory above the current one.
cd ..
Enter the root directory.
cd /
Enter directory1, which happens to be located just underneath the root directory.
cd /directory1
If you are not sure which directory you are currently in, enter the "pwd" command to find out.
Copying, Moving, and Deleting Files in Unix
The following commands are used to copy, delete, rename, and move files in Unix. If you are used to MS-DOS commands, the commands are different. However, the commands behave identically to MS-DOS in almost all cases.
Create an empty file.
touch filename
Copy filename1 to filename2.
cp filename1 filename2
Copy filename1 to /directory1 and rename it filename2.
cp filename1 /directory1/filename2
Remove filename1
rm filename1
Move filename1 to filename2. This is effectively Unix's rename file command as well.
mv filename1 filename2
Unix File Permissions
The next thing to learn is how Unix file permissions work. Some systems have complex security mechanisms such as SELinux and roles, but all Unix variants fall back upon the owner / group / world model discussed here.
In Unix, there are permissions for the owner, group, and the world for all files. The owner is typically a user. The group is usually a set of users that belong in a single group. The world is for everyone. Each file has a minimum of three attributes called read, write, and execute. Read is the ability to view a file. Write is the ability to modify or delete a file. Execute is the ability to run a file from the command line. Below are some examples of Unix file permissions.
For user and group, add permission to read filename1.
chmod ug+r filename1
For group and other (world), remove permission to execute filename1.
chmod go-x filename1
One of the most common things to do in Unix related to permissions is to add execute permission to a Unix script file so that you can run it. Without the execute permission, nobody can run the script from the Unix command line.
Unix File Editors
There isn't a tutorial for editing files. The reason for this is because the only editor that is always available on all variants of Unix is called "vi." Unfortunately, vi can take some time to learn. There are other editors available that are easier to use, but they are not consistently on all variants of Unix.
Some other text based editors that are available include emacs, jove, and pico. Other editors are graphical. Using a graphical text editor such as OpenOffice is fine, but make sure word wrap is turned off if you are editing scripts or configuration files.
In the long run, you are best served by learning vi first, because it will always be available on all Unix systems. This is especially true for older legacy Unix systems that you might run into.
After completing and understanding this tutorial, you should be well on your way to learning how to confidently use a Unix system. Other things will be easier to learn since you know how to navigate around file systems and modify Unix file permissions.
Posted on Utopian.io - Rewarding Open Source Contributors
Your contribution cannot be approved yet because it is attached to the wrong repository. Please edit your contribution and fix the repository to reapply for approval.
You may edit your post here, as shown below:
You can contact us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Done.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey @haig I am @utopian-io. I have just upvoted you!
Achievements
Suggestions
Get Noticed!
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit