Re: [Bulk] Re: The name "grep"

看板FB_questions作者時間11年前 (2014/07/08 09:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串8/9 (看更多)
On Mon, 07 Jul 2014 19:30:41 +0200, Ralf Mardorf wrote: > Yes, I agree with "dd [options] -i infile -o outfile" - Polytropon, but > there's a difference between cp/mv and dd. > > You can not copy or move e.g. a MBR, but you can dd a MBR. A superuser > could damage the system with mv and cp too, but dd anyway is operating > on another level. This is because cp and mv operate on files (on file system level), in contrast to dd which can _also_ operate on the next lower level (on device level), which makes it an excellent tool of messing things up when used with fat fingers. I know this. :-) An alternative approach would have been to create pseudo-files for device-level "entities", such as /proc represents processes and even more. See for example what Plan 9 from Bell Labs did. So it could be possible to have a file, say /dev/da0.mbr, which would allow access to the MBR of the first disk: % cp /dev/da0.mbr /var/backup/mymbr The "funny" part starts with % rm /dev/da0.mbr % mv /dev/da0.parttable /home/bob because there are much more questions open... :-) > Sometimes the FreeBSD syntax IMO goes much to far, for example I > compared ls from FreeBSD and Linux. > > $ uname -a > FreeBSD freebsd 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec 4 09:23:10 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 > $ ls -hAl ~/.xsession-errors > -rw------- 1 rocketmouse rocketmouse 4.0k Jul 7 19:20 /home/rocketmouse/.xsession-errors > $ ls .xsession-errors -hAl > ls: -hAl: No such file or directory > .xsession-errors > $ As mentioned before, we see "DOS/JCL positional parameters" here, as written in "man ls": ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwx1] [-D format] [file ...] The file argument has to follow the options. > [rocketmouse@archlinux ~]$ uname -a > Linux archlinux 3.15.3-1-ARCH #1 SMP PREEMPT Tue Jul 1 07:32:45 CEST 2014 x86_64 GNU/Linux > [rocketmouse@archlinux ~]$ ls -hAl ~/.xsession-errors > -rw------- 1 rocketmouse rocketmouse 1.4K Jul 7 19:26 /home/rocketmouse/.xsession-errors > [rocketmouse@archlinux ~]$ ls .xsession-errors -hAl > -rw------- 1 rocketmouse rocketmouse 1.4K Jul 7 19:26 .xsession-errors > [rocketmouse@archlinux ~]$ If you have manpages on that system, just see if "man ls" mentions something different - obviously the _implementation_ of how program arguments are being processed is different. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
文章代碼(AID): #1JkqBF7R (FB_questions)
討論串 (同標題文章)
文章代碼(AID): #1JkqBF7R (FB_questions)