From owner-freebsd-questions@FreeBSD.ORG Tue Jul 8 00:38:57 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 002EBF26 for ; Tue, 8 Jul 2014 00:38:56 +0000 (UTC) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2F1C2291 for ; Tue, 8 Jul 2014 00:38:56 +0000 (UTC) Received: from r56.edvax.de (port-92-195-69-249.dynamic.qsc.de [92.195.69.249]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id 989B63CC5C; Tue, 8 Jul 2014 02:38:53 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id s680crre002043; Tue, 8 Jul 2014 02:38:53 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Tue, 8 Jul 2014 02:38:53 +0200 From: Polytropon To: Ralf Mardorf Subject: Re: [Bulk] Re: The name "grep" Message-Id: <20140708023853.f30f34b9.freebsd@edvax.de> In-Reply-To: <1404754241.815.1.camel@archlinux> References: <20140707075443.d47ca06a.freebsd@edvax.de> <53BA4F77.60907@qeng-ho.org> <20140707104403.5a0694ff.freebsd@edvax.de> <53BA71A7.9040208@qeng-ho.org> <1404728392.19389.1.camel@archlinux> <53BA9EC0.9000201@qeng-ho.org> <20140707160528.7ecf9855.freebsd@edvax.de> <1404750481.19389.12.camel@archlinux> <53BAD236.3060501@qeng-ho.org> <1404754241.815.1.camel@archlinux> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 00:38:57 -0000 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, ...