本文作为对之前linux学习的补充
目录
一 命令拓展
命令一:
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再选中即可
#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循环中初始化变量,参考文章
(2)中文乱码问题
在windows上编写的文件,上传至Linux上,vim编辑时乱码。原因是windows默认使用gbk编码,在Linux上,使用iconv命令可以转码:
#iconv -f GBK -t UTF-8 test.txt -o test2.txt
再次vim编辑时OK。
3.共享文件夹
例如增加一个“share”文件夹,然后
cd /mnt/hgfs/share
就可以看到文件夹内的内容了
4.ftp
windows:ipconfig
linux:if config
win下ping一下Linux的地址是否相通
然后就可以使用ftp,进行互传了
如 FileZilia Git
四 vmware 虚拟化网络配置
这里可以添加网络
这里可以修改
linux中可以ping一个ip地址看看是否已经被使用,没被使用可以改过去。
windows