linux系统基础学习

2024-04-14 17:41:02 浏览数 (3)

一.pwd

代码语言:linux复制
bio08@ecm-cefa:~$ pwd
/home/bio08

二.mkdir

代码语言:linux复制
bio08@ecm-cefa:~$ mkdir project
bio08@ecm-cefa:~$ mkdir src
bio08@ecm-cefa:~$ mkdir biosoft

三.is和rm

代码语言:linux复制
bio08@ecm-cefa:~$ ls 
biosoft  project  src
bio08@ecm-cefa:~$ rmdir project
bio08@ecm-cefa:~$ ls 
biosoft  src

四.cd

代码语言:linux复制
bio08@ecm-cefa:~$ mkdir tmp
bio08@ecm-cefa:~$ cd tmp
bio08@ecm-cefa:~/tmp$ pwd
/home/bio08/tmp
bio08@ecm-cefa:~/tmp$ cd -
/home/bio08
bio08@ecm-cefa:~$ 

五.cd与rm

代码语言:linux复制
bio08@ecm-cefa:~/tmp$ mkdir huahua
bio08@ecm-cefa:~/tmp$ cd huahua
bio08@ecm-cefa:~/tmp/huahua$ touch haha.txt
bio08@ecm-cefa:~/tmp/huahua$ cd -
/home/bio08/tmp
bio08@ecm-cefa:~/tmp$ cd rm_test
bio08@ecm-cefa:~/tmp/rm_test$ rm doodle.txt 
bio08@ecm-cefa:~/tmp/rm_test$ cd -
/home/bio08/tmp
bio08@ecm-cefa:~/tmp$ rm-r huahua
rm-r: command not found
bio08@ecm-cefa:~/tmp$ rm -r huahua
bio08@ecm-cefa:~/tmp$ rmdir rm_test
bio08@ecm-cefa:~/tmp$ ls 
bio08@ecm-cefa:~/tmp$ 

六.vi与cat与head

代码语言:linux复制
bio08@ecm-cefa:~/tmp$ vi gettysburg
bio08@ecm-cefa:~/tmp$ cat gettysburg
bio08@ecm-cefa:~/tmp$ head gettysburg adress.txt
==> gettysburg <==
[200~Four score and seven years ago
Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure.
But, in a larger sense, we cannot dedicate, we cannot consecrate, we cannot hallow this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract.
The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us:that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion;that we here highly resolve that these dead shall not have died in vain;that this nation, under God, shall have a new birth of freedom;and that government of the people, by the people, for the people, shall not perish from the earth.

七.mv

代码语言:linux复制
bio08@ecm-cefa:~/tmp$ touch new_file.txt
bio08@ecm-cefa:~/tmp$ mv new_file.txt home.txt
bio08@ecm-cefa:~/tmp$ mv home.text ~
bio08@ecm-cefa:~/tmp$ pwd
/home/bio08/tmp
bio08@ecm-cefa:~/tmp$ cd
bio08@ecm-cefa:~$ ls 
biosoft  home.txt  src  tmp

八.问题

  1. ls输出的是横向的列表,怎样输出长格式列表
代码语言:linux复制
bio08@ecm-cefa:~$ ls -l
total 12
drwxrwxr-x 2 bio08 bio08 4096 Apr 14 16:53 biosoft
-rw-rw-r-- 1 bio08 bio08    0 Apr 14 17:25 home.txt
drwxrwxr-x 2 bio08 bio08 4096 Apr 14 16:39 src
drwxrwxr-x 2 bio08 bio08 4096 Apr 14 17:26 tmp

2.如何查看长格式列表中文件的大小?

同上

3.查看Linux系统版本、内存与硬盘空间?

系统版本 uname -v

内存 free

硬盘空间 df

4.建立层级目录和删除层级目录

mkdir-p tmp/tmp1/tmp2

rm -r tmp1

0 人点赞