what is shell

shell

When  we say command line,we  are really reffering to the shell.Shell is a programm that takes keyboard commands and passes them to the operating system to carry out.

 

terminal emulator

When using a graphical user interface, we need another program called terminal emulator(仿真器) to interact with(交互) the shell.

for example,KDE(one of the desktops) uses konsole and GNOME( one of the desktops) uses gnome-terminal.

                     they are all basically do the same thing——give us access to the shell

 

The first button

Launch the terminal emulator! Once it comes up ,we should see something like this:

or

This is called a shell prompt and it will appear whenever the shell is ready to accept input.

It will usually include your username@machinename   current working directory and a dollar sign(when common user)or a pound sign(when superuser/administrative)

 Assuming(假定) that things are good so far,let's start our first button.Type some gibberish(乱语,快速而不清楚的语言) at the prompt like so:

Since(因为) this command make no sense,the shell will tell us so and give us another chance

 

Command History

If we press the the up-arrow(向上的箭头) key,we will see that the previous command reappears after the prompt.This is called command history.

Most Linux distributions remember the last five hundred commands by default.Press the down-arrow key and the prievious command disappears.

 

Move cursor(光标)

While the shell is all about the keyboard(虽然shell是和键盘打交道的),you can also use a mouse with your terminal emulator.There is a mechanism built into the X Window System(the underlying engine that makes the GUI go)that supports a quick copy and paste technique.(X窗口系统(使GUI工作的底层引擎)内建立了一种机制,支持快速复制和粘贴的技巧。)If you

highlight some text by holding down the left mouse button and dragging(拖拉) the mouse over it(or double clicking on a word),it  is copied into a buffer(缓冲区) maintained(维护) by X.Pressing the middle mouse button will cause the text  to be pasted at the cursor loacation.

chinese finishing :

                         copy: (1)highlight some text by holding down the left mouse button and dragging(拖拉) the mouse over it

                                   (2)double clicking on a word

                         paste:pressing the middle mouse button

Note:Don't be tempted(冒...的险) to use Ctrl-c and Ctrl-v to perform copy and paste inside a terminal window.They don't work.These control codes have different meanings to the shell and were assigned(分配) many years before Microsoft Windows.

 

Your graphical desktop environment(most likely KDE or GNOME),in an effort to behave like Windows,probably has its focus policy set to "click to focus." This means for a window to get focus(become active) you nedd to click on it ,This is contrary(相反的) to the traditional X behavior of "focus follows mouse" which means that a window gets focus by just passing the mouse over it.The window will not come to the foreground(前端窗口)until you click on it but it will be able to receive input.Setting the focus policy to "focus follows mouse" will make the copy and paste technique even more useful.Give it a try,I think if you give it a chance you will prefer it.You will find this setting in the configuration program for your window manager.

 

Try a few simple commands

Now that we have learned to type,let's try a few simple commands.The first one is date.This command displays the current time and date

A related command is cal which,by default,displays a calendar of the current month.

to see the current amount of free space on your disk drives,type df:

Likewise,to display the amount of free memory,type the free command

End a terminal session

We can end a terminal session by either closing the terminal emulator window,or by entering the exit command at the shell prompt:

Backroom console(幕后控制台)

Even if we have no terminal emulator running,serval terminal sessions continue to run behind the graphical desktop.Called virtual consoles,these sessions can be accessed on most Linux distributions by pressing Ctrl-Alt-F1 through Ctrl-Alt-F6 on most systems.When a session is accessed,it presents(显示) a login prompt into which we can enter our user name and password.To switch from one virtual console to another,press Alt and F1-F6.To return to the graphical desktop,press Alt-F7.

 

转载于:https://www.cnblogs.com/itmeatball/p/7492510.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值