What are the core commands of linux system

PHPz
Release: 2023-05-21 21:37:04
forward
1252 people have browsed it

System core command

cd

> Linux中切换目录的命令。

格式:

  cd  路径(需要切换的目录路径)



路径:

-  绝对路径:从根路径开始
-  相对路径:从当前目录开始

-  特殊路径:
   - .  : 当前目录
   - .. :
Copy after login

ls

View the files under the corresponding path.

ls   路径(默认是当前路径)

要求:在当前目录查看/root目录下有哪些文件?

```

参数:

-a : 显示隐藏文件(隐藏文件:在Linux系统中,以.开头的文件及文件夹就可以称之为隐藏文件或隐藏文件夹)

```bash
[root@localhost yum.repos.d]# ls -a ../../root
.  ..  anaconda-ks.cfg  .bash_history  .bash_logout  .bash_profile  .bashrc  .cshrc  .tcshrc
``

-l : 列出指定路径下的文件详细信息

```
[root@localhost yum.repos.d]# ls -l ../../root
Copy after login

pwd

> 显示当前所在路径。

[root@localhost yum.repos.d]# pwd
/etc/yum.repos.d
[root@localhost yum.repos.d]# cd /root/
[root@localhost ~]# pwd
/root
[root@localhost ~]#
Copy after login

cat

> 查看文件内容的命令

格式:

cat   [路径]文件名称
Copy after login

mv

Move a file

格式:
mv [原来的文件路径]  [新的文件的路径]



可以使用*匹配多个文件。

```bash
[root@localhost yum.repos.d]# mv CentOS-* backup/
mv: overwrite ‘backup/CentOS-Base.repo’? y
[root@localhost yum.repos.d]# ls -l
total 0
drwxr-xr-x. 2 root root 187 Mar  3 16:14 backup
[root@localhost yum.repos.d]#
Copy after login

View System version

[root@localhost yum.repos.d]# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core)
Copy after login

The above is the detailed content of What are the core commands of linux system. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!