Unveiling the mystery of Linux --- operating system commands


I started learning Linux virtual machine recently, but I felt very ignorant at the beginning. There are a lot of operation instructions. I do n’t know how to start for a while, so I summarize the basic knowledge of Linux. I hope it can provide some help for everyone ’s learning.

1.

ctrl + shift + =      // 为放大字体
ctrl + -              // 为缩小字体
ctrl + alt + t        // 为打开终端
clean                 // 清屏ls
tab                   // 自动补全目录

2. Just press Enter

ls      // 查看当前文件夹下内容
pwd     // 查看当前所在文件夹

3. The following need to add objects, and then press Enter

cd        // 切换文件夹(注意空格pwd)
touch 	  // 如果文件不存在,新建文件
mkdir     // 创建文件夹(目录)
mkdir -p a/b/c/d   //(创建a文件,a包含了b,b包含了c,c包含了d)
rm        // 删除指定文件(不能删除文件夹(目录))
rm -d     // 文件夹名 (删除文件夹(目录))
rm  -r    // 文件夹名 (删除文件夹(单目录和多目录))
rm -f     // (强力删除,不提示任何信息)

4. Command query two methods

command --help   
man command 

5. Common commands for files and directories

ls       // 查看目录内容
cd       // 切换目录
touch    // 创建文件(当文件不存在时创建,如果已存在,则修改日期)
rm mkdir // 删除
cp       // 拷贝 
mv       // 移动

6. Hidden files start with.

touch .123.txt  // (以ls不可看见,ls -a(目录全部)才可见)
                // 删除时 rm .123.txt
                // . 代表为当前目录  
                // .. 代表上一级目录  例如(cd ..  为返回上一级目录)

7. ls commonly used commands

ls -a           // 显示全部文件(包括隐藏的文件)
ls -l           // 显示文件的详细信息
ls -l -h        // 人性化的显示文件的详细信息(ls -lh与前边那种书写相同)

8. base

B   字节  一般为8位二进制数
K   1K = 1024 B
M   1M = 1024 B
G   1G = 1024 M
T   1T = 1024 G  

9. Wildcards

.     		  // 代表任意个数个字符
?    		 // 代表任意一个字符 至少一个
[]    		  // 代表可以匹配字符组中任意一个
[abc] 		  // 匹配 a b c 中任意一个
[a-f] 		  // 匹配 a 到 f 范围的任意一个字符

ls 1*         // (显示以1开头的文件) 
ls *1.txt     // (显示以1.txt结尾的文件)
ls [1-3].txt

/ ******************* /// cd expansion

cd            // 切换到当前用户的主目录(/home/用户目录)
cd ~ 		  // 切换到当前用户的主目录(/home/用户目录)
cd .          // 保留在当前目录
cd ..         // 切换到上一级目录
cd -          // 切换最近两次目录

/ ******************* /// Relative path and absolute path

cd /home/zdaxian/Desktop    // 绝对路径 
                            // 相对路径  最前边不是/- 便是相对目录所在目录位置

If you have any questions, please leave me a message

hexo blog: https: www.ho-brother.ltd
Published 5 original articles · Likes0 · Visits 44

Guess you like

Origin blog.csdn.net/qq_44955863/article/details/105596231