Jump to content
xisto Community
sinx

Help A Beginner To Learn To Use Linux Terminals Help linux terminals

Recommended Posts

Linux terminals are your comunication with BASH
Bourne, Again, SHell.
Basically the latest shell.

You could spend months learning bash, its a very usefull tool.

Its a method of comunicating with running programs, its also a programming language.

Fortunatly, you dont need to know everything about BASH to use it.

This will get you started,
http://linux.org.mt/article/terminal/

it covers the basics you need.
but its not a complete guide, it doesnt go into programming, or advance techniques.

Share this post


Link to post
Share on other sites

Yea I would say just look through a few tutorials, and remember that typing man command will give you the manual for whatever command you give it, this helps alot if you like to explore things on your own.Few quick tips:ls - lists all files in current directoryrm/rmdir - remove a file or directory respectivly... DOES NOT GIVE YOU A "are you sure you want to delete?" type message. So be careful lol.cd directory will move you around the directories.so yes, read some tutorials, play around, and enjoy. Once you can use the terminal its got some awesome fun stuff to use

Share this post


Link to post
Share on other sites

Few trick which may help you:when typing a command whose fullcommand name lets say is this_command press TAB key after lets say this_ ..it will provide you with some options to complete the name or complete the name of the command. This also goes for any file name.~/ is you home director ..ie when ever you do cd ~/ you will go to your home directory. Similary if you do ~user/ you will go to that users directory ..if you have permission.If you are outside of Grpahics mode ..you can use Alt F1 , aLT F2 etc to switch to diffet terminals ..if you have graphics on you can use Ctrl Alt F1 etc to go to text mode..and normally Alt Ctrl F7 to back to graphics (depends ..how many terminals you are running..i think this is some thing default ..but this could be differnt ..ie F5 or F6 perhaps)one of the most useful thin in linux is grep. You can capture ..or uncapture a line with it (lay man way of saying it)A way to do is by pipeslest say you know that cat blah will spill out the contents of file blah on screen. You can use cat blah | grep name to capture all lines with text name in themsimilarly cat blah | grep -v name will capture all lines ..except for lines having text name in themjust few tricks ..which will help you get startedRead the tutorials mentioned..preferably from some University Unix Course Website ..it will give you a comprehensive background:)

Share this post


Link to post
Share on other sites

Very nice topic.the question is : help with "terminal".And the answer is a help for bash !Ok, that's rather true.Terminal is a way of talking with your computer, giving instructions directly to Unix. And bash is a sub-language of Unix, so it's usefuls for that purpose.And for course, it's not the only way. Bourne Shell, ksh and csh are other sub-languages, not very different from each other, and all similar by the fact that they are Unix commande languages.

Share this post


Link to post
Share on other sites

I think you need to understand the Linux file system first..

 

The Linux/UNIX filesystem is made up mainly of two types of files - normal files and directories. "Normal" files include programs, text, imanges, etc. Directories are files which can contain other files, including other directories. Their use is for organising files. If you are familiar with Microsoft Windows, a directory on UNIX/Linux is the same thing as a "folder" in Windows terminology.

 

When you open a terminals, your initial position in filesystem is your home directory.

 

Try to type pwd and press enter. (pwd -- Print Working Directory)

The output of pwd is the pathname of your current directory. e.g. /home/sinx

as you can see, the directory names are separated by forward slash, /. This is different from MS-DOS which uses the backslash, "\". The root directory is "/". All files and directories in the filesystem are located underneath the root directory. That's why all full pathnames will start with "/".

 

You can list the files in your current directory using the ls (list) command. there are some opthins you may specify for ls command:

-l (LONG listing-show all file details)

-a (ALL files, including files starting with "." that are normally hidden)

-t (Sort by TIME last modified)

-R (RECURSIVE listing -show contents of subdirectoryes as well)

 

After this, I think you will understand the filesystem is hierarchically structured.

 

Next step is to know how to navigating the Filesystem. I will post something about that later.

Share this post


Link to post
Share on other sites

I myself use ksh... but commonly, most of the shell depends on what you're trying to do. Here are the commands I can list off the top of my head, I hope it helps.ls = list files in current directorycd = change directorymkdir = make new directoryrm = removemv = move, but can also be used as a tool to rename fileschmod = change permissions on a filelocate = used to find filesNow, when you're referring to files, say, you want to execute a file in the current directory, you must type ./ and then the filename to let it know you want the current directory...if you're using the cd command, to go to the directory above, use "cd .."you might want to search google for a list of unix commands, but this will get you started.

Share this post


Link to post
Share on other sites

Thanks the empty calorie,

You just post what i want to say, navigating the Filesystem.

 

By now, you should be able to move any directory that you want to work in.

This is the first thing that should know.

 

Now I am going to talk about Copying, moving, renaming and deleting files.

 

Linux/UNIX provides the cp command to copy files.

When you copy a file you can name the copy anything you like,

but using names which only include alphanumeric characters a-z, A-Z, 0-9is safer.

cp also has options which allow you to copy groups of files and whole directories easily. Please check with man command.

 

Moving and renaming files is done with mv command.

mv is used to move one or more files between directoried or to rename a file. using mv command to move a file to the same directory with different name is know as renaming the file.

rm , short for "remove", deletes files.

 

Here are an examples, assume that there are two file, filea and fileb, in /pub directory.

 

cd                              (change to your home directory)cp /pub/filea ~/filea           (copy filea form /pub to your home directory)cp /pub/fileb ~/fileb           (copy fileb form /pub to your home directory)ls                              (list files in your home directory)mkdir blah                      (create a directory blah in your home directory)mv filea blah                   (move filea to directory blah)ls                               (list files in your home directory)cd blah                          (change to blah directory)ls                               (list files in blah directory)cd ..                           (change to upper directory, your home directory)mv fileb filec                  (rename fileb to filec)ls                               (list files in your home directory)rm filec                       (delet filec)

Share this post


Link to post
Share on other sites

I started with this great guide: http://linux.about.com/od/dist/gr/dstwubi.htm

I started with it, but unfortunately never ended because of a lack of time :) . This will learn you how to administrate your linux pc. It might be that not every tool works because it's not installed, but don't worry too much about it (yet).

Share this post


Link to post
Share on other sites

Veiwing file in Terminal

You can use two utilites for viewing text files on the screen: cat and more

 

cat is used for viewing short files (less than one page), and more is used for wiewing longer, multi-0page files.

cat merely writes the file to the screen and then exites.

more provides a simple interface to move backwards and forwards through a file.

"f" or "Space" key to move a page forward,

"Enter" key to move a line forward,

"b" to move a page back and

"q" to quit.

if you want to just look at the beginneing or end of the file you can use the

head and tail commands.

 

Actually there is a third utility for viewing files, called less

less is better than more. In fact, less is an improved version of the more program that allows more flexible scrolling and searching within the file.

Too see how it works, run less words (assum there is a text file named words),

Then press the "h" key for help. more is a good starting point for viewing files, but many expert user prefer less

Share this post


Link to post
Share on other sites

And the funny thing is :

most of these commands are very similar to ms-dos command-line commands.

Probably very few people remember this time, where PC's only had a teminal environment, the system booted and then showed a prompt A>

And you had to manyally type

cd mygames
game.bat

And today, when you go to highschool, the teacher teaches you how the filesystem structure is, and how you have to manipulate files in order to install things, for instance a game, on your computer.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.