linux系统入门-1

Ubuntu有几个快捷键

  • CTRL+ALT+T:打开终端,天天使用终端,用鼠标打开太低效了;
  • CTRL+SHIFT+T:新建标签页,编程时有重要应用;
  • ALT+数字N:终端中切换到第N个标签页,编程时有重要应用;
  • Tab:终端中命令补全,当输入某个命令的开头的一部分后,按下Tab键就可以得到提示或者帮助完成;
  • 上下键盘:切换命令历史,刚输入一个很长的命令,按上键就可以恢复;
  • CTRL+C:中断程序运行。

Linux架构

在这里插入图片描述

简单理解操作系统全貌

在这里插入图片描述

命令入门

登录Linux后,我们就可以在#或$符后面去输入命令,有的时候命令后面还会跟着选项(options)或参数(arguments)。即Linux中命令格式为:

command [options] [arguments] //中括号代表是可选的,即有些命令不需要选项也不需要参数

man命令

man是manual的缩写,我们可以通过man man来查看man的帮助。

1是普通的Linux命令
2是系统调用,操作系统的提供的服务接口
3是库函数, C语言中的函数
5是指文件的格式,比如passwd, 就会说明这个文件中各个字段的含义
6是给游戏留的,由各个游戏自己定义
7是附件还有一些变量,比如向environ这种全局变量在这里就有说明
8是系统管理用的命令,这些命令只能由root使用,如ifconfig

使用man命令对初学者来说并不友好 下面介绍两种方式

1.cheat 命令

cheat 命令不是Linux自带的,需要安装

sudo apt-get install python-pip git
sudo pip install docopt pygments
git clone https://github.com/chrisallenlane/cheat.git
cd cheat
sudo python setup.py install

2.tldr命令

pip install tldr

示例使用如下;

root@iZwz9at7nu2rprqr8qtn2oZ:~# tldr find
# find                                                                                                                       
                                                                                                                             
  Find files or directories under the given directory tree, recursively.                                                     
                                                                                                                             
- Find files by extension:                                                                                                   
                                                                                                                             
  find root_path -name '*.ext'                                                                                               
                                                                                                                             
- Find files by matching multiple patterns:                                                                                  
                                                                                                                             
  find root_path -name '*pattern_1*' -or -name '*pattern_2*'                                                                 
                                                                                                                             
- Find directories matching a given name:                                                                                    
                                                                                                                             
  find root_path -type d -name *lib*                                                                                         
                                                                                                                             
- Find files matching path pattern:                                                                                          
                                                                                                                             
  find root_path -path '**/lib/**/*.ext'                                                                                     
                                                                                                                             
- Run a command for each file, use {} within the command to access the filename:                                             
                                                                                                                             
  find root_path -name '*.ext' -exec wc -l {} \;                                                                             
                                                                                                                             
- Find files modified in the last 24-hour period:                                                                            
                                                                                                                             
  find root_path -mtime -1                                                                                                   
                                                                                                                             
- Find files using case insensitive name matching, of a certain size:                                                        
                                                                                                                             
  find root_path -size +500k -size -10M -iname '*.TaR.gZ'                                                                    
                                                                                                                             
- Delete files by name, older than 180 days:                                                                                 
                                                                                                                             
  find root_path -name '*.ext' -mtime +180 -delete                                                                           
                                                                                                                             
- Find files matching a given pattern, while excluding specific paths:                                                       
                                                                                                                             
  find root_path -name '*.py' -not -path '*/site-packages/*'                                                                 
                                                                                                                             
                                                                

命令行单词管理工具 iSearch

root@iZwz9at7nu2rprqr8qtn2oZ:~# s sun
sun 不在本地,从有道词典查询
sun /sʌn/

1. N-SING The sun is the ball of fire in the sky that the Earth goes around, and that gives us heat and light. 太阳 

例: The sun was now high in the southern sky. 太阳当时正高挂在南面天空上。 

例: The sun came out, briefly. 太阳出来了,时间很短。 

2. N-UNCOUNT You refer to the light and heat that reach us from the sun as the sun . 阳光 

例: Dena took them into the courtyard to sit in the sun. 德娜把他们带到院子里坐在阳光下。

【同近义词】

n. [天]太阳

sonne

vi. [天]晒太阳

bask

【双语例句】

 You are my Sun and Moon , my Everything .你是我的太阳和月亮 ,我的一切。

 You are my sunflower I am not your sun .你是我的向日葵 ,我却不是你的太阳。

 Only in the sun .只在太阳下会这样。

若存入本地,请输入优先级(1~5) ,否则 Enter 跳过

猜你喜欢

转载自blog.csdn.net/qq_41175951/article/details/90599727