From owner-freebsd-questions@freebsd.org Wed Feb 20 22:44:32 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89C8414DF68E for ; Wed, 20 Feb 2019 22:44:32 +0000 (UTC) (envelope-from alexmiroslav@gmail.com) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B11272BFD for ; Wed, 20 Feb 2019 22:44:31 +0000 (UTC) (envelope-from alexmiroslav@gmail.com) Received: by mail-wr1-x42d.google.com with SMTP id f14so27959356wrg.1 for ; Wed, 20 Feb 2019 14:44:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=H4S0IZT2o1NIcnckiTKU7N7J2imIO7hylTHVEsCfQFk=; b=UZaR5ZdoZNgzVIHtvVQVdvwbJMEv/RDbmG+9Ii0PCe2vKZsTp+ugzeSIKzFrv0Er3L 7Agg3skKbqVHPCBkJIUGthf7TVtgQdgBphSUHccSVLmgWvvxWqZ0oFZearzV7dxKszma jhROzK6P99JD3t2oZUeBRRUP4GwAxzLghLi22mZApSJIkcHmRZYun/Bx0bZyR1tAPnXH pEKIDscbqeb8nOEDMC5FYJr35jJhpTM2yvdSWoT0EsO4ehBDPqLN+ijxNwZ/ci/klkoP iOdE0EtL8xsiPlTbHbgbBy16zu0witR3RG9duYLbnI6PZepWWotJaRHQ5MwJUEj6d69T gGJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=H4S0IZT2o1NIcnckiTKU7N7J2imIO7hylTHVEsCfQFk=; b=BrWDR3tdHAI9Wbby6k09sS99PCbtirHCwRqvzXjF/zJKWw9t7fbrbOGEPHliNvatjP dBXubTEfX7nqQrdHXizlTk7+ZQqwr+YNeGtiCrKpwwNFQywmctQ5eZZqPEb+E/i7KmRd 8kWCwiIpEbo3KXXZwnmzIg+NAId74mAomgxTQ36UTI1vqn1JuZcl9KkAChH+vAfLc/5G ew8grmUAsNwdy/dOi9I+Tgc8dcYRrMWBtuZsahVQYk0cSO8mRVN62AuF0dbVbtksiPu8 ZZIOi9mEFwJQhwFi45U5UN6WGGWb7NxRWLHcFQ5/zTrVWQ9mzGqmXlG3Gkvo3lN1LyRQ FirA== X-Gm-Message-State: AHQUAuYiPCMC1xohdKiGtPt06n43AzmR+7reMj3eBviFKPggl/wFIXan Xtcw0Zdiikkgc/tYbgAG7er+daBV5lVGCaTAuqQi4w== X-Google-Smtp-Source: AHgI3Ib9C8Rn8CB2eTn4os5Assfqq9R7fNUfFQW5kXnWqcCmqtaBw/RefJD8fNOUCgxRgbcioWYTpiKEKNLl1qVKHLY= X-Received: by 2002:adf:e98c:: with SMTP id h12mr27368989wrm.302.1550702670063; Wed, 20 Feb 2019 14:44:30 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Aleksandr Miroslav Date: Wed, 20 Feb 2019 14:44:18 -0800 Message-ID: Subject: Re: silly (non-bsd) split/cat question (solved) To: freebsd-questions@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 6B11272BFD X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=UZaR5Zdo; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of alexmiroslav@gmail.com designates 2a00:1450:4864:20::42d as permitted sender) smtp.mailfrom=alexmiroslav@gmail.com X-Spamd-Result: default: False [-6.81 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[d.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.82)[ip: (-9.76), ipnet: 2a00:1450::/32(-2.26), asn: 15169(-1.99), country: US(-0.07)]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 22:44:32 -0000 On Wed, Feb 20, 2019 at 11:15 AM Aleksandr Miroslav wrote: > So my question is this: if I have bigfile, which is about 12GiB in > size, and I have 9GiB left of free disk space, how do I split bigfile > into files of about 2GiB? Figured it out. There's a command called "truncate" that will cut off the end of any file in-place. Using split, I cut up bigfile, but while the split is still running I delete the first couple of files. So for bigfile above, I ran "split -b 2g bigfile &" and then "rm xaa" and "rm xab" after those files were created, but while the rest of the files were being created. This left me with xac, xad, xae, and xaf, ie. the last 4 chunks of the split. I then used truncate to reduce bigfile to the size of the first two chunks. I then ran the same split command again to create the first two chunks. This solved my problem. (There's probably an easier way to do this with dd and its skip parameter.)