Home System Tutorial LINUX Summary of linux system instructions

Summary of linux system instructions

Jul 16, 2024 am 11:39 AM
linux linux tutorial Red Hat linux system linux command linux certification red hat linux linux video

Summary of linux system instructions

Commonly used commands:
clear 清屏
pwd Print Working Directory的缩写,可显示当前所在工作目录的全路径
whoami 当前用户的用户名
file -name- 显示详细信息
Copy after login
File related commands:
touch 创建文件
cp 复制文件
mv 移动文件,cp和mv在移动复制过程中可以修改文件名,mv可以完成重命名的功能
rm 删除文件,删除后不经过回收站,直接删除,基本无法找回
find 查找文件,-name 以文件名查找
chmod 修改文件权限
r4 w2 x1
例如:chmod 644 文件名
显示:类型 | 所有者 | 同组 | 其他
ln 创建链接文件
硬链接,如果目标文件被删除,不影响链接的访问,它链接的是文件的内容
软链接,如果目标文件删除,则链接文件就不能访问
Copy after login
Directory related commands:
Linux的目录结构:
/ 根目录
~ 当前用户的主目录
.. 当前目录的上一级
. 代表当前目录
mkdir 创建目录 -p 补全所缺失的路径
rmdir 删除空目录
rm -rf 删除非空目录
cp 复制目录
tar 压缩、解压缩目录,压缩 -zcvf、解压 -zxvf
chmod -R 以递归的方式
PS:目录就是特殊的文件,操作文件的命令也可以用来操作目录,只是需要加些额外的参数。目录文件只能创建软链接。
Copy after login
Network related commands:
ifconfig/ipconfig查看或设置网络配置信息
ping 测试网络是否连通
Linux默认会一直执行,需要用C+c退出。
windows默认只执行4次,/t会一直执行。
Copy after login
Remote login command:
telnet:早期使用,明码传输数据。
ssh zhizhen@106.14.147.81采用加密通信,安全,在windows需要安装额外的程序
Copy after login
File Transfer File:
ftp:简单文件传输协议。
ssh:密文传输保障安全,可以通过命令service sshd status来查看sshd服务是否开启
Copy after login
Admin command:
ubuntu系统的用户分类:
1.超级用户root,在ubuntu中默认不开户
sudo passwd root 重置密码
2.管理员用户
使用sudo命令可能获取到超级权限
3.普通用户
只能在自己的主目录下活动(/home/用户名)
4.访客用户

sudo apt-get update 更新软件源
sudo apt-get upgrade 更新系统
sudo apt-get install pack安装新程序
sudo apt-get install vim
sudo apt-get install g++
sudo apt-get install typespeed
sudo apt-get remove pack 删除软件
sudo apt-get autoremove pack 自动删除
sudo apt-get install -f 自动补全缺少的依赖文件
sudo reboot 重启
sudo init 0 关机
Copy after login
Wildcard:
* 代表任何任意多个字符
? 代表任意一个字符
Copy after login
Redirect:
> 以清空方式创建一个新文件来存储
>> 以追加方式定入,在原来的基础上添加。
Copy after login
Pipeline:
| 把一条命令的执行结束输入给另外一条命令。
find / | grep "name"
grep -r "name" *
续行符
\ 当命令一行无法写守时使用
Copy after login
Help Manual:
man cmd
1 系统命令
2 系统函数
3 C语言标准库函数
q 键退出
Copy after login
Terminal usage tips:
Ctrl+A+t 打开终端
Shift+Ctrl+t 新终端标签(在同一目录下)
F11 全屏
up/down 调出命令记录
Ctrl+l 清屏
Tab 补全,如果匹配的内容太多,回车翻一行,空格翻一页。
Copy after login
Terminal configuration:
终端配置文件 ~/.bashrc,每次新添加添加内容要使用source重新加载,如果删除内容,要关闭终端重新启动。
命令提示符:PS1
取别名alias
alias name='cmd -arg'
自定义函数
$n 代表第几个参数。
Copy after login
Basic scripting:
把Linux系统命令,记录在文件中,加入一些流程控制语句,形成的文本文件。
默认是没有执行权限的,需要使用chmod 添加执行权限才能执行。
./脚本名(脚本名一般以sh结尾)
Copy after login

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

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1676
14
PHP Tutorial
1278
29
C# Tutorial
1257
24
Linux Architecture: Unveiling the 5 Basic Components Linux Architecture: Unveiling the 5 Basic Components Apr 20, 2025 am 12:04 AM

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

How to check the warehouse address of git How to check the warehouse address of git Apr 17, 2025 pm 01:54 PM

To view the Git repository address, perform the following steps: 1. Open the command line and navigate to the repository directory; 2. Run the "git remote -v" command; 3. View the repository name in the output and its corresponding address.

How to run java code in notepad How to run java code in notepad Apr 16, 2025 pm 07:39 PM

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

How to run sublime after writing the code How to run sublime after writing the code Apr 16, 2025 am 08:51 AM

There are six ways to run code in Sublime: through hotkeys, menus, build systems, command lines, set default build systems, and custom build commands, and run individual files/projects by right-clicking on projects/files. The build system availability depends on the installation of Sublime Text.

What is the main purpose of Linux? What is the main purpose of Linux? Apr 16, 2025 am 12:19 AM

The main uses of Linux include: 1. Server operating system, 2. Embedded system, 3. Desktop operating system, 4. Development and testing environment. Linux excels in these areas, providing stability, security and efficient development tools.

git software installation git software installation Apr 17, 2025 am 11:57 AM

Installing Git software includes the following steps: Download the installation package and run the installation package to verify the installation configuration Git installation Git Bash (Windows only)

laravel installation code laravel installation code Apr 18, 2025 pm 12:30 PM

To install Laravel, follow these steps in sequence: Install Composer (for macOS/Linux and Windows) Install Laravel Installer Create a new project Start Service Access Application (URL: http://127.0.0.1:8000) Set up the database connection (if required)

How to set important Git configuration global properties How to set important Git configuration global properties Apr 17, 2025 pm 12:21 PM

There are many ways to customize a development environment, but the global Git configuration file is one that is most likely to be used for custom settings such as usernames, emails, preferred text editors, and remote branches. Here are the key things you need to know about global Git configuration files.

See all articles