$ sudochown -c user1 a b c d changed ownership of "b" from user to user1 changed ownership of "c" from user to user1 changed ownership of "d" from user to user1
$ sudochown -v user1 a b c d changed ownership of "a" from user to user1 changed ownership of "b" from user to user1 changed ownership of "c" from user to user1 changed ownership of "d" from user to user1
$ sudochown -c user1 a b c d changed ownership of "b" from user to user1 changed ownership of "c" from user to user1 changed ownership of "d" from user to user1
$ sudochown -v user1 a b c d changed ownership of "a" from user to user1 changed ownership of "b" from user to user1 changed ownership of "c" from user to user1 changed ownership of "d" from user to user1
backup an entire copy of a hard disk to another hard disk
1
# dd if=/dev/sda of=/dev/sdb conv=sync,noerror
cbs=BYTES
convert BYTES bytes at a time
conv=CONVS
convert the file as per the comma separated symbol list
ibs=BYTES
read up to BYTES bytes at a time (default: 512)
iflag=FLAGS
read as per the comma separated symbol list
obs=BYTES
write BYTES bytes at a time (default: 512)
oflag=FLAGS
write as per the comma separated symbol list
seek=N skip N obs-sized blocks at start of output
skip=N skip N ibs-sized blocks at start of input
status=LEVEL
The LEVEL of information to print to stderr; 'none' suppresses everything but error messages, 'noxfer'
suppresses the final transfer statistics, 'progress' shows periodic transfer statistics
N and BYTES may be followed by the following multiplicative suffixes: c =1, w =2, b =512, kB =1000, K =1024,
MB =1000*1000, M =1024*1024, xM =M, GB =1000*1000*1000, G =1024*1024*1024, and so on for T, P, E, Z, Y.
Each CONV symbol may be:
ascii from EBCDIC to ASCII
ebcdic from ASCII to EBCDIC
ibm from ASCII to alternate EBCDIC
block pad newline-terminated records with spaces to cbs-size
unblock
replace trailing spaces in cbs-size records with newline
lcase change upper case to lower case
ucase change lower case to upper case
sparse try to seek rather than write the output for NUL input blocks
swab swap every pair of input bytes
sync pad every input block with NULs to ibs-size; when used with block or unblock, pad with spaces rather
than NULs
excl fail if the output file already exists
nocreat
do not create the output file
notrunc
do not truncate the output file
noerror
continue after read errors
fdatasync
physically write output file data before finishing
fsync likewise, but also write metadata
Each FLAG symbol may be:
append append mode (makes sense only for output; conv=notrunc suggested)
direct use direct I/O for data
directory
fail unless a directory
dsync use synchronized I/O for data
sync likewise, but also for metadata
fullblock
accumulate full blocks of input (iflag only)
nonblock
use non-blocking I/O
noatime
do not update access time
nocache
Request to drop cache. See also oflag=sync
noctty do not assign controlling terminal from file
nofollow
do not follow symlinks
count_bytes
treat 'count=N' as a byte count (iflag only)
skip_bytes
treat 'skip=N' as a byte count (iflag only)
seek_bytes
treat 'seek=N' as a byte count (oflag only)
Sending a USR1 signal to a running 'dd' process makes it print I/O statistics to standard error and then re‐
sume copying.
$ split aa $ ls -rw-rw-r-- 1 user user 611037792 Jan 15 22:09 aa -rw-rw-r-- 1 user user 356533 Jan 15 22:10 xaa -rw-rw-r-- 1 user user 377414 Jan 15 22:10 xab -rw-rw-r-- 1 user user 346342 Jan 15 22:10 xac -rw-rw-r-- 1 user user 358728 Jan 15 22:10 xad -rw-rw-r-- 1 user user 391466 Jan 15 22:10 xae -rw-rw-r-- 1 user user 368786 Jan 15 22:10 xaf -rw-rw-r-- 1 user user 377274 Jan 15 22:10 xag -rw-rw-r-- 1 user user 393500 Jan 15 22:10 xah -rw-rw-r-- 1 user user 362512 Jan 15 22:10 xai -rw-rw-r-- 1 user user 365170 Jan 15 22:10 xaj -rw-rw-r-- 1 user user 362878 Jan 15 22:10 xak -rw-rw-r-- 1 user user 387394 Jan 15 22:10 xal -rw-rw-r-- 1 user user 355614 Jan 15 22:10 xam -rw-rw-r-- 1 user user 366420 Jan 15 22:10 xan -rw-rw-r-- 1 user user 368912 Jan 15 22:10 xao -rw-rw-r-- 1 user user 350226 Jan 15 22:10 xap -rw-rw-r-- 1 user user 386102 Jan 15 22:10 xaq -rw-rw-r-- 1 user user 377292 Jan 15 22:10 xar -rw-rw-r-- 1 user user 376416 Jan 15 22:10 xas -rw-rw-r-- 1 user user 347584 Jan 15 22:10 xat -rw-rw-r-- 1 user user 376586 Jan 15 22:10 xau -rw-rw-r-- 1 user user 352778 Jan 15 22:10 xav -rw-rw-r-- 1 user user 380608 Jan 15 22:10 xaw -rw-rw-r-- 1 user user 356634 Jan 15 22:10 xax -rw-rw-r-- 1 user user 377414 Jan 15 22:10 xay -rw-rw-r-- 1 user user 346342 Jan 15 22:10 xaz
切分为1MB的文件
可以使用-b参数,切分为准确字节的文件,如下:
1 2 3 4 5 6 7 8 9 10
$ split aa -b 1024000 $ ll -rw-rw-r-- 1 user user 611037792 Jan 15 22:09 aa -rw-rw-r-- 1 user user 1024000 Jan 15 22:15 xaa -rw-rw-r-- 1 user user 1024000 Jan 15 22:15 xab -rw-rw-r-- 1 user user 1024000 Jan 15 22:15 xac -rw-rw-r-- 1 user user 1024000 Jan 15 22:15 xad -rw-rw-r-- 1 user user 1024000 Jan 15 22:15 xae -rw-rw-r-- 1 user user 1024000 Jan 15 22:15 xaf
指定前缀
这个参数直接跟在输入的文件后面即可,如下:
1 2 3 4 5 6 7 8 9 10
$ split aa DAT $ ls aa DATaa DATab DATac DATad DATae DATaf
$ git log --oneline --decorate f30ab (HEAD -> master, testing) add feature #32 - ability to add new formats to the central interface 34ac2 Fixed bug #1328 - stack overflow under certain conditions 98ca9 The initial commit of my project
$ git log --oneline --decorate --graph --all * c2b9e (HEAD, master) made other changes | * 87ab2 (testing) made a change |/ * f30ab add feature #32 - ability to add new formats to the * 34ac2 fixed bug #1328 - stack overflow under certain conditions * 98ca9 initial commit of my project
$ git checkout iss53 Switched to branch "iss53" $ vim index.html $ git commit -a -m 'finished the new footer [issue 53]' [iss53 ad82d7a] finished the new footer [issue 53] 1 file changed, 1 insertion(+)
This message is displayed because 'merge.tool' is not configured. See 'git mergetool --tool-help' or 'git help config'for more details. 'git mergetool' will now attempt to use one of the following tools: opendiff kdiff3 tkdiff xxdiff meld tortoisemerge gvimdiff diffuse diffmerge ecmerge p4merge araxis bc3 codecompare vimdiff emerge Merging: index.html
Normal merge conflict for'index.html': {local}: modified file {remote}: modified file Hit return to start merge resolution tool (opendiff):
如果你想使用除默认工具(在这里 Git 使用 opendiff 做为默认的合并工具,因为作者在 Mac 上运行该程序) 外的其他合并工具,你可以在 “下列工具中(one of the following tools)” 这句后面看到所有支持的合并工具。 然后输入你喜欢的工具名字就可以了。