Skip to main content

Questions tagged [truncate]

Filter by
Sorted by
Tagged with
4 votes
2 answers
573 views

The manual of truncate shows I can add < for "at most". What is this for? It sounds like the default to me.
rubo77's user avatar
  • 30.6k
-1 votes
1 answer
163 views

I am trying to create a file with hole using the truncate command. I read up in some posts and one of the answers in this post says to use truncate command. Filesystem used is btrfs. This is the ...
Shivanshu Arora's user avatar
0 votes
1 answer
615 views

I have built a custom image of Armbian with a partition size of 3.1 GB, and I am now finished working with it. It is currently written to a bootable 64 GB SD card which is using a GUID partition table ...
Chris Hudlin's user avatar
0 votes
0 answers
717 views

I have a script that writes to a logfile like this: $ nohup myscript.sh > myscript.out 2>&1 & when the log file gets very large, I need to truncate it like this: > myscript.out I ...
chiwal's user avatar
  • 1
0 votes
1 answer
1k views

I just expanded my 1GB "homefile" which is mounted to /home/user by another GB using truncate -s +1G homefile. While it changed the size of homefile shown with df to 2GB, when mounted it is ...
alchemy's user avatar
  • 817
2 votes
2 answers
2k views

If I try truncate -s 0 log.log (:>log.log has same behavior) the displayd space on disk do become free but the size (ls -l) of file is still the same (tho du shows less). As far as I understand, it ...
Sova's user avatar
  • 23
29 votes
6 answers
37k views

I am trying to send messages from kafka-console-producer.sh, which is #!/bin/bash if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then export KAFKA_HEAP_OPTS="-Xmx512M" fi exec $(...
Dims's user avatar
  • 3,485
1 vote
0 answers
252 views

I my Ubuntu server that is running Python/Celery has about 9 log files totaling to 9GB space. Is it safe to reduce the size of these files by running the following command? truncate -s 0 *log If not,...
user1761583's user avatar
1 vote
1 answer
115 views

This sequence of commands works OK: pngtopnm file.png 2> /dev/null > dump1 pnmfile < dump1 stdin: PPM raw, 1920 by 1080 maxval 255 ls -l dump1 -rw-r----- 1 cmb 6220817 Sep 15 14:26 dump1 ...
ColinB's user avatar
  • 113
0 votes
0 answers
72 views

firstly sorry for my English. I want to truncate kernel options like Bluetooth, mouse, keyboard etc.. except for my use. but how can I know that kernel options related to devices that I want to remove?...
Jinwoo Bae's user avatar
-1 votes
1 answer
482 views

I have these 2 scripts, one is writing to the file: #!/usr/bin/env bash while true; do sleep 1; echo "$(uuidgen)" >> /tmp/cprev.stdout.log done; the other is reading the last 10 lines ...
Alexander Mills's user avatar
0 votes
1 answer
1k views

In my workplace, I've inherited the responsibility of managing a web server. It's a CentOS Linux virtual machine, running on Amazon AWS EC2. Alongside serving web pages, there is a pile of scheduled ...
osullic's user avatar
  • 255
11 votes
9 answers
8k views

It is possible to remove trailing bytes of a file without writting to a new file (> newfile) and moving it back (mv newfile file). That is done with truncate: truncate -s -1 file It is possible to ...
user avatar
2 votes
2 answers
802 views

I want to use the truncate command to create a huge number of small files for testing. I tried the command with a small number of files (100) and it worked. When I changed the number to 1000000, it ...
Just a learner's user avatar
4 votes
1 answer
2k views

$ timeout 1 cat /dev/zero > file1 $ wc -c file1 270422016 file1 $ du file1 264084 file1 Questions : (1) How do 270422016 null characters come out to be 264084 bytes (i.e 258M). $ truncate -s ...
GypsyCosmonaut's user avatar
0 votes
2 answers
3k views

I am trying to download a streaming mp3 using wget. this is my basic command: wget http://sj128.hnux.com/sj128.mp3 -c --timeout=1 --waitretry=0 --tries=0 -O "file.mp3" i have been doing this in a ...
Low Information Voter's user avatar
1 vote
1 answer
725 views

If I have a path with dots in the path, for instance: /home/user/Documents/hello/test.testing_23-24.123/test.testing_23-24.124 ffmpeg can locate the file if you pass the file's path as an argument ...
sternumbeef's user avatar
1 vote
1 answer
833 views

I know that pr -m -t file1 file2 will give me 2 columns like so: file1: a abc abcdefg abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz file2: 1 123 12345678 12345678901234567890 - $ pr -m -t ...
Timothy Swan's user avatar
0 votes
1 answer
579 views

I have an rsync.net account that has hit its quota and I'm trying to remove (rm -rf) a directory to clean up space. However all the remove commands I can think of to try (rm, truncate, find -delete, ...
mpr's user avatar
  • 1,204
1 vote
1 answer
619 views

What size blocks does GNU truncate --io-blocks use? -o, --io-blocks treat SIZE as number of IO blocks instead of bytes 512 bytes blockdev --getbsz blockdev --getpbsz
Tom Hale's user avatar
  • 33.4k
293 votes
3 answers
478k views

I am aware of three methods to delete all entries from a file. They are >filename touch filename1 filename < /dev/null Of these three I abuse >filename the most as that requires the least ...
debal's user avatar
  • 3,764