Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 165517

Manipulating files: copying, renaming, searching, analyzing, archiving, etc. For operating on text in a file, see /text-processing. For questions about the Files file manager (formerly Nautilus), see /nautilus.

2
votes
should be: # Same as before but for images that are 99% similar. findimagedupes -t 99 -R -- . Suppose a directory had these files: white.png foo.png. bar.png. baz.jpg green.png ...where white.png … was known to be white, green.png was known to be green, and the other were uncertain. Since findimagedupes outputs any similar files on the same line, (space separated), this would show only the white …
answered Oct 13 '16 by agc
1
vote
The default login for Linux Mint is as a regular user, (suppose that user name is "ak"), and user ak's write permissions are usually only for what's in /home/ak. The other partitions are not in /home …
answered Oct 21 '17 by agc
2
votes
sed version: ls 2016090*.jpg | sed -n '/9_154038/,/8_121201/p'
answered Sep 25 '16 by agc
20
votes
Borrowing from don_crissti's answer using tee, but without dd or bashisms: sudo tee /dev/disk2 /dev/disk3 > /dev/disk4 < masi.img Using pee from Debian's moreutils package: sudo dd if=masi.img | …
answered May 20 '16 by agc
1
vote
This uses sponge from Debian's moreutils package. No bashisms. Backup the four input files however you like, (since this will change them), then: # enumerate headers of each file, then sort each … file, in place for f in file* ; do sed '1s/.*/&'"$f"'/;s/file//' $f | sort | sponge $f done # join sorted files, output to 'fileN' for f in 34 N2 N1 ; do join --header file[$f] | sponge fileN …
answered May 27 '16 by agc
1
vote
Case 2: Avoid that directory with find: sed -i 's/foo/bar/g' `find . -maxdepth 1 -type f` Case 3: The problem is the <"$file" in the loop, that turns the file into a stream so sed never sees a fi …
answered Apr 7 '17 by agc
4
votes
No need for a script, just use du -d 0 -t 2200M -h /some/dir/name/*. Example. Use du to show all files in /bin greater than 500K: du -d 0 -t 500K -h /bin/* Output: 1.1M /bin/bash 620K …
answered Nov 20 '17 by agc
1
vote
Linux shells generally don't have any variable types. There are just strings, and the maximum length of a string can be had by running getconf ARG_MAX; on my system the maximum string is about 2M char …
answered May 9 by agc
0
votes
One sed command should be enough, given that input file format: sed '1!{s/^/mv /;s/$/.tar.gz/e}' names.txt Demo, without the e: sed '1!{s/^/mv /;s/$/.tar.gz/}' names.txt Output: Tar.gz_filena …
answered Apr 20 '18 by agc
3
votes
With a bashism, and a functionally "useless use of cat", but closest to the syntax the OP uses: cat <(dd if=file1 bs=1M count=99 skip=1) \ <(dd if=file2 bs=1M count=10) \ > final_output (Th …
answered May 2 '16 by agc
1
vote
Try badblocks, which seems to work on regular files provided the files aren't open: badblocks -b 512 -vn image.jpg Example on a real 13K file: sudo badblocks -b 512 -vn \ /usr …
answered May 12 '18 by agc
0
votes
Same reason as bashBedlam's answer's, but different code, (no -n option needed, this saves two bytes), just change this line: howmany=${2:-10} To this: howmany=${2:--10}
answered Jun 28 '17 by agc
1
vote
Using wc: wc -c * 2> /dev/null If all that's needed is the total, do: wc -c * 2> /dev/null | tail -1
answered Feb 24 '18 by agc