Linux:Ubuntu补充学习

本文作为对之前linux学习的补充

目录

本文作为对之前linux学习的补充

一 命令拓展

命令一:

ctrl + Alt + T

命令二:

xrandr

xrandr -s 1920x1080

命令三:

clear  /  快捷键ctrl + l

命令四:

cd..

命令五:

mv *.c 文件夹

命令六:

su root

exit

二 Vim

vi

I

Tab

Esc

:wq

:q!

gcc

./

三 linux虚拟机和windows间文件传输

1.直接拖拽

2.系统间差异

 3.共享文件夹

4.ftp

四 vmware 虚拟化网络配置

1. Bridge 桥接模式

2. NAT 网络地址转换模式

3. Host-only 仅主机模式


一 命令拓展

命令一:

ctrl + Alt + T

命令二:

xrandr

调出支持的窗口大小

xrandr -s 1920x1080

调整到需要的大小

CLC@Embed_Learn:~$ xrandr
Screen 0: minimum 1 x 1, current 1718 x 938, maximum 8192 x 8192
Virtual1 connected 1718x938+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1718x938       60.0*+
   2560x1600      60.0  
   1920x1440      60.0  
   1856x1392      60.0  
   1792x1344      60.0  
   1920x1200      59.9  
   1600x1200      60.0  
   1680x1050      60.0  
   1400x1050      60.0  
   1280x1024      60.0  
   1440x900       59.9  
   1280x960       60.0  
   1360x768       60.0  
   1280x800       59.8  
   1152x864       75.0  
   1280x768       59.9  
   1024x768       60.0  
   800x600        60.3  
   640x480        59.9  
Virtual2 disconnected (normal left inverted right x axis y axis)
Virtual3 disconnected (normal left inverted right x axis y axis)
Virtual4 disconnected (normal left inverted right x axis y axis)
Virtual5 disconnected (normal left inverted right x axis y axis)
Virtual6 disconnected (normal left inverted right x axis y axis)
Virtual7 disconnected (normal left inverted right x axis y axis)
Virtual8 disconnected (normal left inverted right x axis y axis)
CLC@Embed_Learn:~$ xrandr -s 1360x768
CLC@Embed_Learn:~$ xrandr -s 1680x1050

命令三:

clear  /  快捷键ctrl + l

清屏

命令四:

cd..

返回上一级文件夹

命令五:

mv *.c 文件夹

*通配符,将所有c文件移动到文件夹

命令六:

su root

进入root模式

exit

可用于退出root模式

二 Vim

vi

打开文本编辑器,没有目标文件自动创建

I

进入编辑模式

Tab

缩进

(24条消息) vim/vi编辑器显示行号、自动缩进、点击鼠标即可移动光标设置_vim自动缩进_乔大辉子的博客-CSDN博客

配置完之后会出现右键无法copy的情况,按住shift再选中即可

 (26条消息) vim 鼠标右键无法复制_victoryckl的博客-CSDN博客

#include <stdio.h>
int main()
{
      printf("hello world!\n");
      return 0;
}

Esc

退出编辑模式

:wq

保存退出

:q!

不保存直接

gcc

gcc 文件名 -o 编译后的文件名

./

运行

CLC@Embed_Learn:~$ vi v.c
CLC@Embed_Learn:~$ gcc v.c -o One
CLC@Embed_Learn:~$ ./One
hello world!
CLC@Embed_Learn:~$ 

三 linux虚拟机和windows间文件传输

1.直接拖拽

百度一下如何安装VMware Tool

然后就可以随意拖动了

2.系统间差异

(1)和windows下存在一些区别

比如for循环,禁止在for循环中初始化变量,参考文章

(24条消息) error: ‘for‘ loop initial declarations are only allowed in C99 mode_error:loop intial de_ʚ兔子的先森ɞ的博客-CSDN博客

 (2)中文乱码问题

在windows上编写的文件,上传至Linux上,vim编辑时乱码。原因是windows默认使用gbk编码,在Linux上,使用iconv命令可以转码:
#iconv -f GBK -t UTF-8 test.txt -o test2.txt

再次vim编辑时OK。

(24条消息) 解决vim编辑文件时中文乱码_vim中文显示乱码_陪你听风的博客-CSDN博客

 vim打开文件中文乱码解决方法总结 - 点滴网 (vycc.cn)

 3.共享文件夹

 例如增加一个“share”文件夹,然后

cd /mnt/hgfs/share

就可以看到文件夹内的内容了

4.ftp

 windows:ipconfig

linux:if config

win下ping一下Linux的地址是否相通

 然后就可以使用ftp,进行互传了

如  FileZilia  Git

四 vmware 虚拟化网络配置

 这里可以添加网络

 这里可以修改

 linux中可以ping一个ip地址看看是否已经被使用,没被使用可以改过去。

 windows

(24条消息) VMware中的三种网络模式_vmware虚拟机三种网络模式详解_小高学起来的博客-CSDN博客

1. Bridge 桥接模式

2. NAT 网络地址转换模式

3. Host-only 仅主机模式

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值