[fedora] how switch between text and graphical consoles

本文介绍如何在Linux系统中通过快捷键在文本和图形界面间切换,并详细讲解了使用VNC进行远程桌面显示及控制的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原文链接:http://www.faqs.org/docs/lnag/lnag_xwindows.html


摘抄几段:

How to switch between text and graphical consoles?

Pressing the key combination  <Ctrl><Alt><F1> will switch you to to the first text console at any time.  <Ctrl><Alt><F2> will switch you to the second text console,  <Ctrl><Alt><F3> to the third text console, etc, up to  <Ctrl><Alt><F6>, for the total of 6 text consoles.  <Ctrl><Alt><F7> will switch you to the first graphical user interface (GUI) console if one is running<Ctrl><Alt><F8> to the second GUI console, etc., up to  <Ctrl><Alt><F11> for the total of 5 GUI consoles.  The 12th console is either used as the 6th GUI (RedHat 6.1) or a place to which kernel messages are continually displayed (Mandrake 7.0, really cool feature). Typically none or only the first GUI console is running.

<Ctrl><Alt><F1> means: "Press the left <Ctrl> and <Alt> keys and hold them. Now press <F1>. Release <F1>. Release <Ctrl> and <Alt> keys."

Thus, sitting at a Linux computer I can have many consoles opened at the same time, and I can switch between them using the hot keys as described above. I have to log in on each console to be able to use it--I may log in as the same user (multiple times), or different users. Each login session is quite separate; they should not interfere with each other (the X sessions sometimes may if you log in as the same user twice). The first 6 consoles are text-based, command-line terminals (CLI, "command line interface") and are named tty1, tty2 ... tty6 (historical name, "tty" stands for "teletypewriter").  The subsequent consoles are graphical (GUI).  These are all *local* consoles--my local linux computer is truely muliuser and multitasking.

You can connect to a Linux computer remotely, over a network. While connected, you can have a program run on the remote Linux server and the display sent to your terminal on your "local" console. This local console can be Linux-based or another operating system-based.  One cannot run programs remotely on an MS Windows server, but it is often used with Linux. It is really helpful to be able to distinguish if your program is run locally or remotely.

The full-screen text consoles are terminals by themselves. Under the GUI consoles, you can also create "slave" pseudo-terminals (in a window) on demand--they will be called pts0, pts1, ....

Sitting at a text terminal, you can determine the name of your terminal using the following command:

tty

I can determine the computer on which my current session is located using:

uname -a

The name of the command "uname" is derived from "UNIX name". It shows the operating system name,  the server name, the version of the operating system kernel, and the time of the compilation of the kernel.

You can close any text terminal by typing "exit" inside it.

The Linux GUI console is quite similar to other GUIs you might have used,  e.g., MS Windows, but there are also numerous important differences. I love multiple "desktops" to stay organized--the default setup in KDE offers 4 desktops (it can be customized to between 1 and 16). I run many programs and never close them, so to stay organized I keep a connectivity application (netscape with all its windows, knode newsreader, and licq) together on Desktop2,  abiword, staroffice and a text editor on Desktop3, games and konqueror with helpfiles on Desktop4, and leave Desktop1 for the more occassional chores.  One can switch between desktops by clicking on the "desktop pager" on the "K-panel" or using <Ctrl><TAB>.  To switch between applications on a same desktop, I may click the application window, or click its icon representation on the "applicaton panel", or use <Alt><TAB> to toggle between the applications. <Ctrl><Esc> will give me a list of the processes currently run on the local machine ("localhost").

Can I have a GUI login prompt?

To start your X-server automatically on the system start-up and display a graphical login prompt, you have to change (as root) just one character in the file  /etc/inittab .  This file specifies something like:
id:3:initdefault:
Change it to
id:5:initdefault:
This sets up the default runlevel to 5, which is X-Windows. The meaning of the different runlevels is explained in the same  /etc/inittab file :
0 - halt (Do NOT set initdefault to this) 
1 - Single user mode 
2 - Multiuser, without NFS (The same as 3, if you do not have networking) 
3 - Full multiuser mode 
4 - unused 
5 - X11 
6 - reboot (Do NOT set initdefault to this)
You can change the runlevel from the command line. E.g., this command (has to be executed as root):
init 6
will reboot your computer, while the following command would switch your computer to a single-user mode:

init 1

To find out which runlevel I am currently at, I use the command runlevel.

To fine-tune the appearance of my X login screen, I can use (under X):

kcontrol &

and select "System"-"Login Manager".  I like a login screen with an analog clock, big font, the login name of the last user already typed in, and the focus pre-set on the password field in the dialog box.

Can I have multiple sessions of X running at the same time?

Yes, you can. When you issue the first  startx command on your system, it opens the first X-session on the default display 0.  The second X-session must be opened on a different display. For example, this will open a second X-session on the  display 1:
startx -- :1
You can have up to 6 concurrent X sessions. Use <Ctrl><Alt><F7> to switch to display 0,  <Ctrl><Alt><F8> to second screen,  etc. up to <Ctrl><Alt><F12>   Try  man startx  if you need more info.
In a similar fashion, you can open another bare X-server session without a window manager. This will open one on display 2:
xinit --  :2
On this bare-bone X-display I can run a different windows manager (so as to have two different ones running at the same time) by typing in the X-terminal window one of these (see the previous answer for more details):
startkde 
gnome-session 
xfce 
afterstep 
AnotherLevel 
fvwm2 
fvwm

Can my sister have second GUI login prompt so she does not have to kill my X-session to start hers?

To enable several concurrent GUI logins on different local consoles under RedHat (RedHat uses program  gdm for graphical logins), I had to edit the file:  /etc/X11/gdm/gdm.conf . I have the following entry at the end of this file to enable 4 login terminals  <Ctrl><Alt><F7>  to  <Ctrl><Alt><F10>:

[servers] 
3=/usr/bin/X11/X vt10 
2=/usr/bin/X11/X vt9 
1=/usr/bin/X11/X vt8 
0=/usr/bin/X11/X vt7

Having four GUI lets me run KDE and GNOME at the same time on one computer with two GUI terminals spare, so my sister can login despite my having screensavers with password-protection.

To enable several concurrent GUI logins on different local consoles under Mandrake (Mandrake uses kdm for graphical logins), I had to modify two files:  /etc/X11/xdm/Xservers to include something like:

:0 local /usr/X11R6/bin/X :0 
:1 local /usr/X11R6/bin/X :1 
:2 local /usr/X11R6/bin/X :2

and  /etc/X11/xdm/xdm-config  to copy all the settings for display 0 to display 1 and 2 so that it includes this:

DisplayManager._0.authorize:    true 
DisplayManager._1.authorize:    true 
DisplayManager._2.authorize:    true 
DisplayManager._0.setup:        /etc/X11/xdm/Xsetup_0 
DisplayManager._0.startup:      /etc/X11/xdm/GiveConsole 
DisplayManager._0.reset:        /etc/X11/xdm/TakeConsole 
DisplayManager._1.setup:        /etc/X11/xdm/Xsetup_0 
DisplayManager._1.startup:      /etc/X11/xdm/GiveConsole 
DisplayManager._1.reset:        /etc/X11/xdm/TakeConsole 
DisplayManager._2.setup:        /etc/X11/xdm/Xsetup_0 
DisplayManager._2.startup:      /etc/X11/xdm/GiveConsole 
DisplayManager._2.reset:        /etc/X11/xdm/TakeConsole

This enables me to run gnome and kde at the same time on a single computer with the third GUI terminal spare.

How do I Display and Control a Remote Desktop using VNC

(VNC  = Virtual Network Computing). A very useful application--don't miss it.

VNC is a cross-platform utility that allows me to display a remote graphical desktop over a standard network connection. For example, I can use VNC on an MS Windows PC to display an X-window environment of my mighty Linux server downstairs, or the other way around. VNC will even run over a 56k modem networking, but probably only for fun or in emergency (too slow a connection for normal work).

Recent Mandrake or RH will have vnc on their distributions CD. The MS Windows version you have to download yourself. See http://www.uk.research.att.com/vnc/ for download information and more details.

On Linux, VNC consists of four commands: vncserver, vncviewer, vncpasswd, and vncconnect. I typically need just two of them: vncserver and vncviewer.  A brief description of the commands follows.

vncserver 
The server that has to be running on the host (remote) computer.  You start the server as the user whose desktop will be displayed (don't run the server as root or somebody else somebody may kidnap your computer!).

vncviewer 
The local application wich connects to the vncserver and displays the remote environment.  You need to know the password and ip address of the server to connect.

vncpasswd 
Password selection utility for vncserver. The server won't run without password (good behaviour). Therefore, if you don't select one, it will prompt you. Hence, I don't need to explicitly run vncpasswd.

vncconnect 
Tells vncserver to connect to a listening VNC viewer on the given computer and port. This way I can avoid giving anybody a password.

Xvnc 
A "master" program that I don't really need to run directly (vncserver and vncviewer are scripts which call Xvnc).

For a list of all available options I run: 
Xvnc -help

It is not recommenced to run the VNC server as root due to potential security issues. If you need root privileges, login as a user and then execute su

Two examples of "typical" sessions follow.

Example 1. Sitting at an MS Window computer, I can display an X environment from my Linux server, using the following sequence:

[start a DOS terminal and type in the following command] 
telnet my_linux_server_name 
[log in to your user account on Linux and type in it the following command] 
vncserver 
[provide a really good password of your choice when prompted; mine was "357+Simon&Garfunkel"] 
[re-enter the same password for confirmation] 
[watch the messages and note the screen number on which the server is started; mine was ":4"] 
[From the "Start" menu on the MS Windows computer, select "Programs" - "Vnc" - "Run VncViewer" 
[in the input box that appears, type the server ip address and screen number as shown on the next line] 
my_linux_server_ip_address:4 
[in the input box that appears type the password as follows] 
357+Simon&Garfunkel 
[an X-windows desktop should now appear on top of your MS Windows desktop] 
[do your work as you normally would in Xwindows] 
[when done, switch to the telnet session window and type in it the following two commands] 
vncserver - kill :4 
logout

Example 2.  Sitting at my Linux X desktop, I can display and remotely control an MS Windows computer screen. Hopefully, nobody else is using this MS Windows computer at the same time, because I move its mouse pointer.

[Walk to the MS Windows computer because you probably cannot telnet it] 
[From the "Start" menu, select "Programs" - "Vnc" - "Run WinVnc (app mode)" 
[From the "System Tray", click the mouse right button on the "Vnc" icon, and select "Properties"] 
[In the dialog box that appears, fill in the password. Leave the screen number on "auto".] 
[Walk back to your Linux desktop] 
[Start an X terminal and type in it] 
vncviewer ms_windows_server_name_or_ip 
[When prompted, type in the password] 
[a MS Windows desktop should now appear on top of your X] 
[do your work as you normally would on MS Windows] 
[When done, right click on the Vnc icon in the system tray and select "Close VNC".]


基于数据挖掘的音乐推荐系统设计与实现 需要一个代码说明,不需要论文 采用python语言,django框架,mysql数据库开发 编程环境:pycharm,mysql8.0 系统分为前台+后台模式开发 网站前台: 用户注册, 登录 搜索音乐,音乐欣赏(可以在线进行播放) 用户登陆时选择相关感兴趣的音乐风格 音乐收藏 音乐推荐算法:(重点) 本课题需要大量用户行为(如播放记录、收藏列表)、音乐特征(如音频特征、歌曲元数据)等数据 (1)根据用户之间相似性或关联性,给一个用户推荐与其相似或有关联的其他用户所感兴趣的音乐; (2)根据音乐之间的相似性或关联性,给一个用户推荐与其感兴趣的音乐相似或有关联的其他音乐。 基于用户的推荐和基于物品的推荐 其中基于用户的推荐是基于用户的相似度找出相似相似用户,然后向目标用户推荐其相似用户喜欢的东西(和你类似的人也喜欢**东西); 而基于物品的推荐是基于物品的相似度找出相似的物品做推荐(喜欢该音乐的人还喜欢了**音乐); 管理员 管理员信息管理 注册用户管理,审核 音乐爬虫(爬虫方式爬取网站音乐数据) 音乐信息管理(上传歌曲MP3,以便前台播放) 音乐收藏管理 用户 用户资料修改 我的音乐收藏 完整前后端源码,部署后可正常运行! 环境说明 开发语言:python后端 python版本:3.7 数据库:mysql 5.7+ 数据库工具:Navicat11+ 开发软件:pycharm
MPU6050是一款广泛应用在无人机、机器人和运动设备中的六轴姿态传感器,它集成了三轴陀螺仪和三轴加速度计。这款传感器能够实时监测并提供设备的角速度和线性加速度数据,对于理解物体的动态运动状态至关重要。在Arduino平台上,通过特定的库文件可以方便地与MPU6050进行通信,获取并解析传感器数据。 `MPU6050.cpp`和`MPU6050.h`是Arduino库的关键组成部分。`MPU6050.h`是头文件,包含了定义传感器接口和函数声明。它定义了类`MPU6050`,该类包含了初始化传感器、读取数据等方法。例如,`begin()`函数用于设置传感器的工作模式和I2C地址,`getAcceleration()`和`getGyroscope()`则分别用于获取加速度和角速度数据。 在Arduino项目中,首先需要包含`MPU6050.h`头文件,然后创建`MPU6050`对象,并调用`begin()`函数初始化传感器。之后,可以通过循环调用`getAcceleration()`和`getGyroscope()`来不断更新传感器读数。为了处理这些原始数据,通常还需要进行校准和滤波,以消除噪声和漂移。 I2C通信协议是MPU6050与Arduino交互的基础,它是一种低引脚数的串行通信协议,允许多个设备共享一对数据线。Arduino板上的Wire库提供了I2C通信的底层支持,使得用户无需深入了解通信细节,就能方便地与MPU6050交互。 MPU6050传感器的数据包括加速度(X、Y、Z轴)和角速度(同样为X、Y、Z轴)。加速度数据可以用来计算物体的静态位置和动态运动,而角速度数据则能反映物体转动的速度。结合这两个数据,可以进一步计算出物体的姿态(如角度和角速度变化)。 在嵌入式开发领域,特别是使用STM32微控制器时,也可以找到类似的库来驱动MPU6050。STM32通常具有更强大的处理能力和更多的GPIO口,可以实现更复杂的控制算法。然而,基本的传感器操作流程和数据处理原理与Arduino平台相似。 在实际应用中,除了基本的传感器读取,还可能涉及到温度补偿、低功耗模式设置、DMP(数字运动处理器)功能的利用等高级特性。DMP可以帮助处理传感器数据,实现更高级的运动估计,减轻主控制器的计算负担。 MPU6050是一个强大的六轴传感器,广泛应用于各种需要实时运动追踪的项目中。通过 Arduino 或 STM32 的库文件,开发者可以轻松地与传感器交互,获取并处理数据,实现各种创新应用。博客和其他开源资源是学习和解决问题的重要途径,通过这些资源,开发者可以获得关于MPU6050的详细信息和实践指南
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值