Linux学习(三)常用命令及文件系统介绍

在这里插入图片描述
Github主页:https://github.com/NonnettaWu


前言

本文主要介绍Linux使用过程中常用的终端命令以及文件系统。


一、Commands

CommandDescription
man <tool>Opens man pages for the specified tool.
<tool> -hPrints the help page of the tool.
apropos <keyword>Searches through man pages’ descriptions for instances of a given keyword.
catConcatenate and print files.
whoamiDisplays current username.
idReturns users identity.
hostnameSets or prints the name of the current host system.
unamePrints operating system name.
pwdReturns working directory name.
ifconfigThe ifconfig utility is used to assign or view an address to a network interface and/or configure network interface parameters.
ipIp is a utility to show or manipulate routing, network devices, interfaces, and tunnels.
netstatShows network status.
ssAnother utility to investigate sockets.
psShows process status.
whoDisplays who is logged in.
envPrints environment or sets and executes a command.
lsblkLists block devices.
lsusbLists USB devices.
lsofLists opened files.
lspciLists PCI devices.
sudoExecute command as a different user.
suThe su utility requests appropriate user credentials via PAM and switches to that user ID (the default user is the superuser). A shell is then executed.
useraddCreates a new user or update default new user information.
userdelDeletes a user account and related files.
usermodModifies a user account.
addgroupAdds a group to the system.
delgroupRemoves a group from the system.
passwdChanges user password.
dpkgInstall, remove and configure Debian-based packages.
aptHigh-level package management command-line utility.
aptitudeAlternative to apt.
snapInstall, remove and configure snap packages.
gemStandard package manager for Ruby.
pipStandard package manager for Python.
gitRevision control system command-line utility.
systemctlCommand-line based service and systemd control manager.
psPrints a snapshot of the current processes.
journalctlQuery the systemd journal.
killSends a signal to a process.
bgPuts a process into background.
jobsLists all processes that are running in the background.
fgPuts a process into the foreground.
curlCommand-line utility to transfer data from or to a server.
wgetAn alternative to curl that downloads files from FTP or HTTP(s) server.
python3 -m http.serverStarts a Python3 web server on TCP port 8000.
lsLists directory contents.
cdChanges the directory.
clearClears the terminal.
touchCreates an empty file.
mkdirCreates a directory.
treeLists the contents of a directory recursively.
mvMove or rename files or directories.
cpCopy files or directories.
nanoTerminal based text editor.
whichReturns the path to a file or link.
findSearches for files in a directory hierarchy.
updatedbUpdates the locale database for existing contents on the system.
locateUses the locale database to find contents on the system.
morePager that is used to read STDOUT or files.
lessAn alternative to more with more features.
headPrints the first ten lines of STDOUT or a file.
tailPrints the last ten lines of STDOUT or a file.
sortSorts the contents of STDOUT or a file.
grepSearches for specific results that contain given patterns.
cutRemoves sections from each line of files.
trReplaces certain characters.
columnCommand-line based utility that formats its input into multiple columns.
awkPattern scanning and processing language.
sedA stream editor for filtering and transforming text.
wcPrints newline, word, and byte counts for a given input.
chmodChanges permission of a file or directory.
chownChanges the owner and group of a file or directory.
Terminal_CommandDescription
man 浏览官方命令文档
--help or -h快速查看命令可选参数
apropos 通过关键字搜索命令
whoami显示当前用户名
id返回用户身份
hostname设置或打印当前主机系统的名称
uname打印有关操作系统名称和系统硬件的基本信息
pwd返回当前工作路径
ifconfig用于分配或查看网络接口的地址或者配置网络接口参数
ip显示或操作路由、网络设备、接口和隧道的程序
netstat显示网络状态
ss另一个调查套接字的实用程序
ps显示进程状态
env打印环境或设置并执行命令
lsblk列出块设备
lsusb列出USB设备
lsof列出打开的文件
lspci列出PCI设备
SSHssh [userName]@[ipAddress]
cat /etc/shadowusersCondition
sudo su or sudo su - 切换用户
adduser 创建新用户
useradd 创建新用户或更新默认的新用户信息
userdel 删除用户账户以及相关文件
usermod修改用户账户
addgroup将组添加到系统
delgroup从系统中删除组
passwd更改用户密码
dpkg一个安装、构建、删除和管理Debian软件包的工具 dpkg -i
apt为包管理系统提供了一个高级命令行界面
aptitude包管理器的高级接口(apt的替代品)
snap安装、配置、刷新和删除snap包并适用于云、服务器、桌面和物联网的最新应用程序和实用程序
gemRubyGems的前端 Ruby的标准包管理器
pipPython包安装程序 推荐用于安装Debian存档中不可用的Python包
gitgit clone
wgetwget
chmodchmod 777 (r=4 w=2 x=1)
Service and ProcessDescription
systemdthe boss daemon
systemctl start such as: systemctl start ssh
systemctl status show service status
systemctl enable reboot with service enable
systemctl restart restart service
systemctl reload reload service
systemctl list-unitslist all process

二、DirSystem

PathDescription
/顶级目录是根文件系统
/bin包含基本的命令二进制文件
/boot由静态引导加载程序、内核可执行文件和引导Linux操作系统所需的文件组成
/dev包含设备文件以方便访问连接到系统的每个硬件设备
/etc本地系统配置文件 (已安装应用程序的配置文件也可保存在此)
/home系统上的每个用户在此处都有一个子目录用于存储
/lib系统引导所需的共享库文件
/media外部可移动媒体设备 (例如USB驱动器)安装在此
/mnt常规文件系统的临时挂载点
/opt第三方工具等可选文件可保存在此
/rootroot用户的主目录
/sbin该目录包含用于系统管理的可执行文件(二进制系统文件)
/tmp操作系统和许多程序使用此目录来存储临时文件(该目录在系统启动时被清除)
/usr包括可执行文件、库、man文件等
/var此目录包含可变数据文件(日志文件、电子邮件收件箱、Web应用程序相关文件、corn文件等
文章部分内容引用于网站:https://academy.hackthebox.com

在这里插入图片描述


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值