相关命令:
执行并放置后台执行 : command &
将后台程序拉回屏幕输出: fg
将当前屏幕执行程序再丢到后台执行:Ctrl Z
执行程序并丢到后台执行 &
[lcf@nut ~]$ acgui&
[1] 14087
把当前后台执行的程序拉回当前屏幕执行 fg
[lcf@nut ~]$ fg
acgui
把已经在当前屏幕执行中的程序丢到后台继续执行 Ctrl Z
[lcf@nut ~]$ fg
acgui
^Z
[1]+ Stopped acgui
seq --help
Usage: seq [OPTION]... LAST
or: seq [OPTION]... FIRST LAST
or: seq [OPTION]... FIRST INCREMENT LAST
Print numbers from FIRST to LAST, in steps of INCREMENT.
Mandatory arguments to long options are mandatory for short options too.
-f, --format=FORMAT use printf style floating-point FORMAT
-s, --separator=STRING use STRING to separate numbers (default: \n)
-w, --equal-width equalize width by padding with leading zeroes
--help display this help and exit
--version output version information and exit
seq 选项[-s " "][-w] FIRST INCREMENT LAST
注意 选项紧跟seq, 位于序列数字FIRST INCREMENT LAST之前,FIRST INCREMENT LAST放在最后
比如
seq -s " " -w 2 100 1000
root@gua-vm1:/vob# seq 10
1
2
3
4
5
6
7
8
9
10
root@gua-vm1:/vob# seq -s " " 10
1 2 3 4 5 6 7 8 9 10
r
打印全部列
awk '{print $0}'
打印指定列
awk '{print $2,$4}'
打印指定列并拼接字符串
awk '{print $1,"hhah",$2}'
awk '{print $1"hahah"$2}'
按指定分隔符取列
awk -F: '{ print $1 }'
打印某一列及后面所有列的内容
awk '{out=""; for(i=2;i<=NF;i++){out=out" "$i}; print out}'
打印最后一列,最后一列的前一列,NF表示最后一列的列号
awk '{print $NF, $(NF-1)}'
打印指定一行,NR表示行号
awk 'NR==6 {print $0}'
打印第六行,以 :分隔开的第一列
awk -F ":" 'NR==6 {print $1}'
打印第4行以后的行
git log --pretty=format:"%H-%h:%h" -n 15 |cat -n | awk 'NR>4 {print $0}'
5 1f021028e22d92119fa5a0821273596e0c37be87-1f02102:1f02102
6 f36b0ad5a376edf485979b357af4ac1df87cc443-f36b0ad:f36b0ad
7 e3776955f8f3592051603d2299b93d3b55cbc52a-e377695:e377695
8 94c50a1fd810d5c1e62535fac8f6db3c01c4c476-94c50a1:94c50a1
git log --pretty=format:"%H-%h:%h" -n 15 |cat -n | awk 'NR<4 {print $0}'
git log --pretty=format:"%H-%h:%h" -n 15 |cat -n | awk 'NR<=4 {print $0}'
条件用法
打印包含 Merge branch 的行 用/strings/
git log --pretty=format:"%
https://docs.gitlab.com/ee/api/README.html
https://stedolan.github.io/jq/manual/#Invokingjq
P_token:
gitlab web : User Setting --> Access Tokens
API_VERSION:
https://gitlab.casa-systems.com/help/api/v3_to_v4.md
In GitLab 9.0 and later, API V4 is the preferred version to be used.
jq command:
https://stedolan.github.io/jq/manual/#Invokingjq
gitlab api 根据指定组名取组对象
curl --header "PRIVATE-TOKEN: $P_token" $GITLAB_INSTANCE/api/$API_VERSION/groups/${GroupName} 2>/dev/null|jq .
curl --header "PRIVATE-TOKEN: $P_token" $GITLAB_INSTANCE/api/$API_VERSION/groups/${GroupName} 2>/dev/null|jq 'keys'
curl --header "PRIVATE-TOKEN: $P_token" $GITLAB_INSTANCE/api/$API_VERSION/groups/${GroupName} 2>/dev/null|jq .projects[0]|jq 'keys'
curl --header "PRIVATE-TOKEN: $P_token" $GITLAB_INSTANCE/api/$API_VERSION/groups/${GroupName
windows 7 , WinSCP-5.9.3-Portable
winscp> help
call Executes arbitrary remote command
cd Changes remote working directory
checksum Calculates checksum of remote file
chmod Changes permissions of remote file
close Closes session
echo Displays its arguments as message
exit Closes all sessions and terminates the program
get Downloads file from remote directory to local directory
help Displays help
keepuptodate Continuously reflects changes in local directory on remote one
lcd Changes local working directory
lls Lists the contents of local directory
ln Creates remote symbolic link
lpwd Prints local working directory
ls Lists the contents of remote directory
mkdir Creates remote directory
mv Moves or renames remote file
open Connects to server
option Sets or shows value of script options
put Uploads file
p2top3命令批量转化语法之后,还有一些 版本2和3之间用法的差异需要手动调整:
在properties 窗口右下“NEW” 点开,选择others
在弹出的窗口的property name 项上,选择:tsvn:logtemplate
保存后,重新commit 一个修改的文件 ,提交窗口会出现刚才设置的log 格式。
列表本目录所占空间
du -sh ./
列表子目录所占空间
du -sh ./*
列表子目录所占空间达到不足1M的
du -sh ./* | grep "^[0-9]\{1,\}.\{0,1\}[0-9]\{1,\}[K]"
列表子目录所占空间达到1M 以上
du -sh ./* | grep "^[0-9]\{1,\}.\{0,1\}[0-9]\{1,\}[M,G]"
列表子目录所占空间达到1G 以上
du -sh ./* | grep "^[0-9]\{1,\}.\{0,1\}[0-9]\{1,\}[G]"
每个级别的列表再按第一列数值排序
du -sh ./* | grep "^[0-9]\{1,\}.\{0,1\}[0-9]\{1,\}[K]"| sort -n
du -sh ./* | grep "^[0-9]\{1,\}.\{0,1\}[0-9]\{1,\}[M]"| sort -n
du -sh ./* | grep "^[0-9]\{1,\}.\{0,1\}[0-9]\{1,\}[G]"| sort -n
在排了序基础上再取最大10 个
du -sh ./* | grep "^[0-9]\{1,\}.\{0,1\}[0-9]\{1,\}[G]" | sort -n | tail -n 10
# <file system> <mount point> <type> <options> <dump> <pass>
以下是官方对fstab 里六个字段用法的解释
For ordinary mounts, it will hold (a link to) a block special device node (as created by mknod(2)) for the device to be mounted, like /dev/cdrom' or
/dev/sdb7'.
LABEL= < label > or UUID= < uuid >
LABEL=< label> or UUID=< uuid> may be given instead of a device name. This is the recommended method, as device names are often a coincidence of hardware detection order, and can change when other disks are added or removed. For example, LABEL=Boot' or
UUID=3e6be9de-8139-11d1-9106-a43f08d823a6'. (Use a filesystem-specific tool like e2label(8), xfs_admin(8), or fatlabel(8) to set LABELs on filesystems).
第一个字段可以是分区名,或标签名,设备id, 用来标记这一行所表示 的文件系统所在的设备块
root@vm1:/vob/GuaKing/DevOps# cat /etc/fstab
# <file system> <mount point> <type> <options> <dum
diskimage-builder code
https://opendev.org/openstack/diskimage-builder官方分区设置
https://docs.openstack.org/diskimage-builder/latest/user_guide/building_an_image.html
If you wish to customise the top-level block-device-default.yaml file
from one of the block-device-* elements, set the environment variable
DIB_BLOCK_DEVICE_CONFIG. This variable must hold YAML structured
configuration data or be a file:// URL reference to a on-disk
configuration file.
在自己自定义的element 的根目录下,创建一个文件block-device-default.yaml,将分区方案按yaml 文件格式配置其中,如果element 下方有一个block-device-default.yaml,则会优先使用用户定义的分区配置,如果用户无定制,则使用默认配置:
https://opendev.org/openstack/diskimage-builder/src/branch/master/diskimage_builder/elements/block-device-mbr/block-device-default.yaml
或使用变量DIB_BLOCK_DEVICE_CONFIG定义分区配置,将block-device-default.yaml的文本赋值给DIB_BLOCK_DEVICE_CONFIG
磁盘全部容量分配r