测试理论--总结测试常用linux命令

简介: 常用linux命令

常用linux命令


1、一级常用


ls,ll,cd,pwd,mv,cp,rm,useradd,userdel,vi,tail,grep,cat,mkdir,tar,zip,unzip

ls -l  列出文件的所有信息

ls -t  按时间排序

ls -rt 按时间倒序

ls -a  列出所有文件(包括隐藏的)

ll : ll = ‘ls -l ’

cd 不带目录名,进入该账户的家目录;带目录,则进入对应的目录

cd ..  进入上一级目录

pwd 查询当前所处的目录

mv 重命名或换路径

cp 复制

rm 删除

rm -rt 删除文件夹不用确认

useradd(groupadd)

userdel(groupdel) -r  删除用户登入目录以及目录中所有文件

vi 编辑

Shift G 到文件最后

:q!     不保存强制退出

:wq!    保存且强制退出

?test   从当前行往前开始搜索test,n 下一个;N 上一个

/test   从当前行往后开始搜索test,n 下一个;N 上一个

tail 显示文件结尾

tail -f **.log  |grep pr_page

cat显示

mkdir 建目录

tar -vcf aa.tar aa

tar -vxf aa.tar aa

tar -zvcf aa.tar.gz aa

tar -zvxf aa.tar.gz aa

zip -r aa.zip aa

unzip aa.zip


2、二级常用


yast,ps,kill,top,find,chmod,chown

ps 查看进程

ps -ef 查看全格式的全部进程

ps -ef|grep <进程名> 查看并筛选 跟进程名有关的进程,该进程名可以是进程的全部或者部分

kill -9 进程号   很强大的强制杀死进程

top 监视进程和Linux整体性能

find 查找

按文件名查找 find ./ -name zxy*

搜索内容包含 find .|xargs grep -ri "mysqld" -l

chmod 修改权限

chown 修改属组


3、三级常用


whoami,ifconfig,date,tcpdump,ping,df,du,mount

whoami 查看当前登录的有效用户

ifconfig 查看网络配置,网卡IP什么的

date 查看系统时间

date -s 修改系统时间

tcpdump 数据采集,抓包用的

ping 判断网络是否联通

df 检查文件系统的磁盘空间占用情况

du 统计目录(或文件)所占磁盘空间的大小

du -sh 总的

mount 挂上文件系统

umount 取消挂上文件系统


Linux 常用命令


  • pwd: print work directory 打印当前目录 显示出当前工作目录的绝对路径

  • ps: process status(进程状态,类似于windows的任务管理器)  常用参数:-auxf  :ps -auxf 显示进程状态

  • df: disk free 其功能是显示磁盘可用空间数目信息及空间结点信息。换句话说,就是报告在任何安装的设备或目录中,还剩多少自由的空间。

  • du: Disk usage

  • rpm:即RedHat Package Management,是RedHat的发明之一

  • rmdir:Remove Directory(删除目录)

  • rm:Remove(删除目录或文件)

  • cat: concatenate 连锁

  • cat file1file2>>file3 把文件1和文件2的内容联合起来放到file3中

  • insmod: install module,载入模块

  • ln -s : link -soft 创建一个软链接,相当于创建一个快捷方式

  • mkdir:Make Directory(创建目录)

  • touch: touch

  • man: Manual

  • su:Swith user(切换用户)

  • cd:Change directory

  • ls:List files

  • ps:Process Status

  • mkdir:Make directory

  • rmdir:Remove directory

  • mkfs: Make file system

  • fsck:File system check

  • uname: Unix name

  • lsmod: List modules

  • mv: Move file

  • rm: Remove file

  • cp: Copy file

  • ln: Link files

  • fg: Foreground

  • bg: Background

  • chown: Change owner

  • chgrp: Change group

  • chmod: Change mode

  • umount: Unmount

  • dd: 本来应根据其功能描述"Convert an copy"命名为"cc",但"cc"已经被用以代表"CComplier",所以命名为"dd"

  • tar:Tape archive (磁带档案)

  • ldd:List dynamic dependencies

  • insmod:Install module

  • rmmod:Remove module

  • lsmod:List module

  • 文件结尾的"rc"(如.bashrc、.xinitrc等):Resource configuration

  • Knnxxx /Snnxxx(位于rcx.d目录下):K(Kill);S(Service);nn(执行顺序号);xxx(服务标识)

  • .a(扩展名a):Archive,static library

  • .so(扩展名so):Shared object,dynamically linked library

  • .o(扩展名o):Object file,complied result of C/C++ source file

  • RPM:Red hat package manager

  • dpkg:Debian package manager

  • apt:Advanced package tool(Debian或基于Debian的发行版中提供)

其他 Linux 命令缩写


  • bin = Binaries (二进制文件)

  • /dev = Devices (设备)

  • /etc = Etcetera (等等)

  • /lib = LIBrary

  • /proc = Processes

  • /sbin = Superuser Binaries (超级用户的二进制文件)

  • /tmp = Temporary (临时)

  • /usr = Unix Shared Resources

  • /var = Variable (变量)

  • FIFO = First In, First Out

  • GRUB = GRand Unified Bootloader

  • IFS= Internal Field Seperators

  • LILO = LInux LOader

  • MySQL = My 是最初作者女儿的名字,

  • SQL = Structured QueryLanguage

  • PHP = Personal Home Page Tools = PHP HypertextPreprocessor

  • PS = Prompt String

  • Perl = “Pratical Extraction and Report Language”(实际的抽取和报告语言) =”Pathologically Eclectic Rubbish Lister”

  • Python 得名于电视剧Monty Python&rsquo;s Flying Circus

  • Tcl = Tool Command Language

  • Tk = ToolKit

  • VT = Video Terminal

  • YaST = Yet Another Setup Tool

  • apache = “a patchy” server

  • apt = Advanced Packaging Tool

  • ar = archiver

  • as = assembler

  • awk = “Aho Weiberger and Kernighan”三个作者的姓的第一个字母

  • bash = Bourne Again SHell

  • bc = Basic (Better) Calculator

  • bg = BackGround

  • biff = 作者HeidiStettner在U.C.Berkely养的一条狗,喜欢对邮递员汪汪叫。

  • cal = Calendar (日历)

  • cat = Catenate (链接)

  • cd = Change Directory

  • chgrp = Change Group

  • chmod = Change Mode

  • chown = Change Owner

  • chsh = Change Shell

  • cmp = compare

  • cobra = Common Object Request BrokerArchitecture

  • comm = common

  • cp = Copy

  • cpio = CoPy In and Out

  • cpp = C Pre Processor

  • cron = Chronos 希腊文时间

  • cups = Common Unix Printing System

  • cvs = Current Version System

  • daemon = Disk And Execution MONitor

  • dc = Desk Calculator

  • dd = Disk Dump (磁盘转储)

  • df = Disk Free

  • diff = Difference

  • dmesg = diagnostic message

  • du = Disk Usage

  • ed = editor

  • egrep = Extended GREP

  • elf = Extensible Linking Format

  • elm = ELectronic Mail

  • emacs = Editor MACroS

  • eval = EVALuate

  • ex = EXtended

  • exec = EXECute (执行)

  • fd = file descriptors

  • fg = ForeGround

  • fgrep = Fixed GREP

  • fmt = format

  • fsck = File System ChecK

  • fstab = FileSystem TABle

  • fvwm = F*** Virtual Window Manager

  • gawk = GNU AWK

  • gpg = GNU Privacy Guard

  • groff = GNU troff

  • hal = Hardware Abstraction Layer

  • joe = Joe&rsquo;s Own Editor

  • ksh = Korn SHell

  • lame = Lame Ain&rsquo;t an MP3 Encoder

  • lex = LEXical analyser

  • lisp = LISt Processing = Lots of IrritatingSuperfluous Parentheses

  • ln = Link

  • lpr = Line PRint

  • ls = list

  • lsof = LiSt Open Files

  • m4 = Macro processor Version 4

  • man = MANual pages

  • mawk = Mike Brennan&rsquo;s AWK

  • mc = Midnight Commander

  • mkfs = MaKe FileSystem

  • mknod = Make Node

  • motd = Message of The Day

  • mozilla = MOsaic GodZILLa

  • mtab = Mount TABle

  • mv = Move

  • nano = Nano&rsquo;s ANOther editor

  • nawk = New AWK

  • nl = Number of Lines

  • nm = names

  • nohup = No HangUP

  • nroff = New ROFF

  • od = Octal Dump

  • passwd = Passwd

  • pg = pager

  • pico = PIne&rsquo;s message COmposition editor

  • pine = “Program for Internet News &Email” = “Pine is not Elm”

  • ping = 拟声 又 = Packet Internet Grouper

  • pirntcap = PRINTer CAPability

  • popd = POP Directory

  • pr = pre

  • printf = Print Formatted

  • ps = Processes Status

  • pty = pseudo tty

  • pushd = PUSH Directory

  • pwd = Print Working Directory

  • rc = runcom = run command, rc还是plan9的shell

  • rev = REVerse

  • rm = ReMove

  • rn = Read News

  • roff = RunOFF

  • rpm = RPM Package Manager = RedHat PackageManager

  • rsh, rlogin, rvim中的

  • r = Remote

  • rxvt = ouR XVT

  • seamoneky = 我

  • sed = Stream Editor

  • seq = SEQuence

  • shar = Shell ARchive

  • slrn = S-Lang rn

  • ssh = Secure Shell

  • ssl = Secure Sockets Layer

  • stty = Set TTY

  • su = Substitute User

  • svn = SubVersion

  • tar = Tape ARchive

  • tcsh = TENEX C shell

  • tee = T (T形水管接口)

  • telnet = TEminaL over Network

  • termcap = terminal capability

  • terminfo = terminal information

  • tex = &tau;έ&chi;&nu;&eta;的缩写,希腊文art

  • tr = traslate

  • troff = Typesetter new ROFF

  • tsort = Topological SORT

  • tty = TeleTypewriter

  • twm = Tom&rsquo;s Window Manager

  • tz = TimeZone

  • udev = Userspace DEV

  • ulimit = User&rsquo;s LIMIT

  • umask = User&rsquo;s MASK

  • uniq = UNIQue

  • i = VIsual = Very Inconvenient

  • vim = Vi IMproved

  • wall = write all

  • wc = Word Count

  • wine = WINE Is Not an Emulator

  • xargs = eXtended ARGuments

  • xdm = X Display Manager

  • xlfd = X Logical Font Description

  • xmms = X Multimedia System

  • xrdb = X Resources DataBase

  • xwd = X Window Dump

  • yacc = yet another compiler compiler

  • Fish = the Friendly Interactive SHell

  • su = Switch User

  • MIME = Multipurpose Internet Mail Extensions

  • ECMA = European Computer ManufacturersAssociation
目录
相关文章
|
Linux 应用服务中间件 Shell
二、Linux文本处理与文件操作核心命令
熟悉了Linux的基本“行走”后,就该拿起真正的“工具”干活了。用grep这个“放大镜”在文件里搜索内容,用find这个“探测器”在系统中寻找文件,再用tar把东西打包带走。最关键的是要学会使用管道符|,它像一条流水线,能把这些命令串联起来,让简单工具组合出强大的功能,比如 ps -ef | grep 'nginx' 就能快速找出nginx进程。
1190 1
二、Linux文本处理与文件操作核心命令
linux命令—stat
`stat` 是 Linux 系统中用于查看文件或文件系统详细状态信息的命令。相比 `ls -l`,它提供更全面的信息,包括文件大小、权限、所有者、时间戳(最后访问、修改、状态变更时间)、inode 号、设备信息等。其常用选项包括 `-f` 查看文件系统状态、`-t` 以简洁格式输出、`-L` 跟踪符号链接,以及 `-c` 或 `--format` 自定义输出格式。通过这些选项,用户可以灵活获取所需信息,适用于系统调试、权限检查、磁盘管理等场景。
920 137
|
安全 Ubuntu Unix
一、初识 Linux 与基本命令
玩转Linux命令行,就像探索一座新城市。首先要熟悉它的“地图”,也就是/根目录下/etc(放配置)、/home(住家)这些核心区域。然后掌握几个“生存口令”:用ls看周围,cd去别处,mkdir建新房,cp/mv搬东西,再用cat或tail看文件内容。最后,别忘了随时按Tab键,它能帮你自动补全命令和路径,是提高效率的第一神器。
1902 58
|
SQL 安全 Linux
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
678 1
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
1350 1
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
|
安全 Linux 网络安全
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
652 2
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
739 1
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
|
存储 安全 Linux
Linux卡在emergency mode怎么办?xfs_repair 命令轻松解决
Linux虚拟机遇紧急模式?别慌!多因磁盘挂载失败。本文教你通过日志定位问题,用`xfs_repair`等工具修复文件系统,三步快速恢复。掌握查日志、修磁盘、验重启,轻松应对紧急模式,保障系统稳定运行。
1829 2
|
Unix Linux 程序员
Linux文本搜索工具grep命令使用指南
以上就是对Linux环境下强大工具 `grep` 的基础到进阶功能介绍。它不仅能够执行简单文字查询任务还能够处理复杂文字处理任务,并且支持强大而灵活地正则表达规范来增加查询精度与效率。无论您是程序员、数据分析师还是系统管理员,在日常工作中熟练运用该命令都将极大提升您处理和分析数据效率。
1107 16
|
缓存 监控 Linux
Linux内存问题排查命令详解
Linux服务器卡顿?可能是内存问题。掌握free、vmstat、sar三大命令,快速排查内存使用情况。free查看实时内存,vmstat诊断系统整体性能瓶颈,sar实现长期监控,三者结合,高效定位并解决内存问题。
1227 0
Linux内存问题排查命令详解