Linux常用命令库
apachectl
grep
openssl
mdadm
groupmems
grub2-mkconfig
grub2-set-default
accept
groupadd
passwd
apk
gpm
paste
7z
grpconv
patch
ag
groupmod
pathchk
ack
grub
perl
arp
groupdel
objdump
atrm
gunzip
pfctl
atq
grpck
pgrep
axel
grpunconv
parted
ab
groups
partprobe
badblocks
halt
php
apt-key
gzip
od
apt-get
head
pigz
apt-sortpkgs
gzexe
pico
apropos
history
pidof
atop
help
pidstat
break
lastlog
ping
aptitude
hexdump
pkill
bg
ldconfig
ntsysv
arch
host
pmap
arpd
hostid
rpm2cpio
arpwatch
htop
ppp-off
as
hostnamectl
poweroff
arptables
hping3
rsync
ar
lilo
pr
arping
ifcfg
script
bzip2recover
htdigest
pssh
cal
hostname
printf
cancel
id
reject
arj
htpasswd
protoize
cd
hwclock
popd
chcon
lpr
pstree
base64
lsblk
pv
batch
iconv
sftp
chgrp
indent
ps
basename
ifconfig
slocate
chmod
ifstat
pstack
bc
ifup
pushd
chown
hdparm
pvscan
blockdev
mkdir
pwd
at
mkinitrd
pwck
builtin
info
pvck
chpasswd
ifdown
pvchange
chroot
iptables
pwconv
bind
mpstat
pvs
bmodinfo
iostat
pvdisplay
cksum
iftop
pvcreate
bye
inotifywait
sshd
bzgrep
ip6tables-restore
pwunconv
chsh
ip
quotacheck
bzcmp
insmod
rcconf
bzcat
ip6tables-save
quota
bzdiff
iotop
rcp
col
init
repquota
clockdiff
install
pvremove
bzip2
ip6tables
restorecon
command
iptables-save
read
comm
ncftp
quotaoff
bzless
ipcrm
return
cmp
ipcs
rev
consoletype
iptstate
quotaon
bunzip2
ipcalc
rename
cat
iperf
resize
bzmore
netstat
readonly
cdrecord
iptables-restore
rmdir
blkid
nice
rexec
cp
jed
restore
cpio
ispell
reboot
chage
jobs
rm
chattr
joe
rlogin
cu
jq
rmmod
chkconfig
kexec
tee
cupsenable
join
rpmbuild
date
iptraf
runlevel
cupsdisable
kernelversion
rpmdb
clear
kill
rsh
clock
jwhois
rpm
chfn
journalctl
scp
dd
lastb
sar
declare
last
route
compress
ld
times
depmod
ln
tftp
alias
let
rpmverify
dc
killall
service
continue
ldd
rpmsign
df
lha
screen
convertquota
lftp
sesearch
dhclient
locate
semanage
dhcpd
less
seinfo
dhcrelay
lftpget
scriptreplay
diff
logger
seq
diffstat
local
setfacl
dig
logsave
readelf
diff3
lp
sed
csplit
logout
sendmail
crontab
logname
rpmquery
dirname
login
set
dirs
lsattr
sftp-server
cut
lvremove
renice
domainname
losetup
setpci
dos2unix
lpadmin
setsid
dpkg-deb
lpc
sysctl
colrm
lnstat
shift
dpkg-preconfigure
look
shutdown
dnsdomainname
logwatch
sh
dpkg-query
lynx
shuf
dpkg-reconfigure
lpq
updatedb
dpkg
lscpu
skill
dpkg-divert
logrotate
shopt
dpkg-statoverride
lpstat
setsebool
dpkg-trigger
lvresize
showmount
dmidecode
gpasswd
tcpreplay
dstat
lprm
slabtop
e2fsck
lvdisplay
squid
du
mail
sort
dircolors
lspci
speedtest-cli
disown
lsof
smbclient
e2label
mesg
vgscan
dump
mailq
split
egrep
ltrace
vdfuse
eject
lsusb
sleep
echo
make
ss
ed
lsmod
ssh-agent
elm
lvcreate
sudo
emacs
mkbootdisk
strings
edquota
lvreduce
spell
ex
lvscan
tmux
exec
mkfs
znew
enable
lsb_release
xrandr
ethtool
nethogs
unarj
elinks
nologin
swapoff
dmesg
neofetch
tar
dris
mke2fs
touch
expand
nslookup
zcat
dpkg-split
md5sum
ssh
export
man
ssh-add
exit
mknod
syslog
dnf
mii-tool
userdel
false
mysqladmin
ssh-copy-id
fdisk
mailstat
ssh-keyscan
find
modprobe
squidclient
fgrep
mkswap
smbpasswd
expr
mtools
source
finger
mkisofs
suspend
env
mapfile
ssh-keygen
fishshell
mktemp
startx
fmt
mysql
swapon
firewall-cmd
more
stty
fping
mv
tail
ftp
nc
talk
file
mount
systemctl
fold
named-checkzone
stat
fc
lvextend
supervisord
gcc
mysqlimport
systool
findfs
mysqldump
sync
fsck
nano
tailf
fg
nl
tac
exportfs
ngrep
su
get_module
newusers
tcpdump
gcov
mysqlshow
test
getsebool
nmcli
zipsplit
gdb
nisdomainname
telinit
free
nmap
tracepath
curl
ntpdate
sum
ftpcount
nm
timedatectl
getenforce
nproc
trap
ftpshut
nfsstat
unlink
ftpwho
nohup
unrar
git
ls
unprotoize
ftptop
type
awk
watch
fuser
ulimit
telnet
whatis
yum
xlsatoms
uucico
xz
tty
wget
uptime
xinit
whoami
xhost
xauth
uname
who
usernetctl
tree
vgreduce
vi
xclip
which
xset
zfore
tempfile
zipinfo
strace
tput
umask
time
umount
unalias
uncompress
whereis
usermod
unset
unexpand
users
uupick
ypdomainname
write
yes
xargs
useradd
uuto
true
unzip
vgdisplay
vgconvert
vgchange
vgremove
vgcreate
vgextend
vgrename
xlsfonts
zip
uniq
tload
xlsclients
traceroute
tr
volname
wall
vmstat
wait
top
w
wc
私有云知识库
-
+
首页
ag
ag === ack 的升级版,C语言编写,更快更人性化 ## 补充说明 **ag命令** 它比ack快一个数量级。它会忽略 .gitignore 和 .hgignore 中的文件模式。如果源代码库中有您不想搜索的文件,只需将它们的模式添加到 .ignore 文件即可。命令名称比 ack 短 33%,并且所有键都在 home 行! [Github-参考链接](https://github.com/ggreer/the_silver_searcher) ### 语法 ```shell ag [options] pattern [path ...] ag [可选项] 匹配模式 [路径...] ``` ### 选项 ```shell Output Options: --ackmate 以 AckMate-parseable 的格式显示结果 -A --after [LINES] 显示匹配行之后的行(默认2行) -B --before [LINES] 显示匹配行之前的行(默认2行) --[no]break 不同文件中匹配到的内容新建一行显示(默认开启) -c --count 只显示每个文件中匹配到的数量 (This often differs from the number of matching lines) --[no]color Print color codes in results (Enabled by default) --color-line-number Color codes for line numbers (Default: 1;33) --color-match Color codes for result match numbers (Default: 30;43) --color-path Color codes for path names (Default: 1;32) --column Print column numbers in results --[no]filename Print file names (Enabled unless searching a single file) -H --[no]heading 在每个文件匹配前输出文件名(默认开启) -C --context [LINES] 显示匹配行上下两行(默认2行) --[no]group Same as --[no]break --[no]heading -g --filename-pattern PATTERN Print filenames matching PATTERN -l --files-with-matches 显示包含匹配的文件名(不显示匹配的行) -L --files-without-matches 只显示不包含匹配项的文件名 --print-all-files Print headings for all files searched, even those that don\'t contain matches --[no]numbers Print line numbers. Default is to omit line numbers when searching streams -o --only-matching 只输出每行匹配的部分 --print-long-lines Print matches on very long lines (Default: >2k characters) --passthrough When searching a stream, print all lines even if they don\'t match --silent Suppress all log messages, including errors --stats Print stats (files scanned, time taken, etc.) --stats-only Print stats and nothing else. (Same as --count when searching a single file) --vimgrep Print results like vim\'s :vimgrep /pattern/g would (it reports every match on the line) -0 --null --print0 Separate filenames with null (for 'xargs -0') Search Options: -a --all-types 搜索所有文件(包括隐藏文件) -D --debug Ridiculous debugging (probably not useful) --depth NUM 目录搜索最大深度(默认25) -f --follow 跟随链接进行搜索 -F --fixed-strings Alias for --literal for compatibility with grep -G --file-search-regex 根据正则匹配搜索指定类型的文件 --hidden Search hidden files (obeys .*ignore files) -i --ignore-case Match case insensitively --ignore PATTERN Ignore files/directories matching PATTERN (literal file/directory names also allowed) --ignore-dir NAME Alias for --ignore for compatibility with ack. -m --max-count NUM 在一个文件中最大匹配的数量(默认: 10,000) --one-device 不跟随其他设备的链接搜索 -p --path-to-ignore STRING Use .ignore file at STRING -Q --literal Don\'t parse PATTERN as a regular expression -s --case-sensitive Match case sensitively -S --smart-case Match case insensitively unless PATTERN contains uppercase characters (Enabled by default) --search-binary 搜索二进制文件 -t --all-text 搜索所有文本文件(不包括隐藏文件) -u --unrestricted 搜索所有文件 (忽略 .ignore, .gitignore, etc.; 搜索二进制和隐藏文件) -U --skip-vcs-ignores Ignore VCS ignore files (.gitignore, .hgignore; still obey .ignore) -v --invert-match 反向匹配 -w --word-regexp 只匹配整个单词 -W --width NUM Truncate match lines after NUM characters -z --search-zip 搜索压缩文件中的内容 File Types: The search can be restricted to certain types of files. Example: ag --html needle 结果输出到指定类型文件 - Searches for 'needle' in files with suffix .htm, .html, .shtml or .xhtml. For a list of supported file types run: ag --list-file-types 列出支持的文件类型 ``` ### 实例 列出当前目录下包含 `npm` 的文件 ```shell ➜ vue-project ag npm ./ README.md 16:npm install 22:npm run dev 28:npm run build ```
admin
2022年9月16日 01:11
69
0 条评论
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
PDF文档
PDF文档(打印)
分享
链接
类型
密码
更新密码