The tag has no wiki summary.

learn more… | top users | synonyms

-1
votes
1answer
51 views

Why doesn't rsync take advantage of the mv command when --remove-source-files is specified?

Assume I want to move a tree in the filesystem, e.g. /path/to/a a.txt b.txt to another location with rsync (3.0.9 protocol version 30), e.g. with rsync -a --remove-source-files /path/to/a/ ...
7
votes
2answers
535 views

Why is `tac file | grep foo' (piping) faster than `grep foo < <(tac file)' (process substitution)?

This question was motivated by "Reverse grepping", about grepping a huge file from bottom up. @chaos said: tac file | grep whatever Or a bit more effective: grep whatever < <(tac file) ...
32
votes
4answers
2k views

Reverse grepping

Let's say, I have a really big text file (about 10.000.000 lines). I need to grep it from the end and save result to a file. What's the most efficient way to accomplish task?
1
vote
1answer
75 views

Do programs access tools like grep, sed, tr, or sort due to their efficiency?

Or it's meaningful only when you are in the command line and want something simple done right away. Are these tools more efficient than a program library?
0
votes
1answer
76 views

Check multiple directory properties

I'd like to make this test as fast as possible: (Bash) if [[ -d $directory_path && -r $directory_path && -x $directory_path ]]
1
vote
3answers
1k views

Compacting `find` name patterns

I am using find . -name '*.[cCHh][cC]' -exec grep -nHr "$1" {} ';' find . -name '*.[cCHh]' -exec grep -nHr "$1" {} ';' to search for a string in all files ending with .c, .C, .h, .H, .cc and .CC ...
2
votes
2answers
261 views

How to compare usage of memory by Window Managers?

I'd like to test a few window managers to see which of them takes less memory and CPU in certain time period (so is better choice for older computers). I'd like to make the tests myself (not to read a ...
1
vote
1answer
446 views

Process priority and cpu speed

In some devices the cpu speed is dynamic, being faster when there is more load. I was wondering if it is possible to set nice level or priority of a process so that it does not influence an increase ...
4
votes
2answers
161 views

check patterns that don't exist in sqlite

I explained a similar situation with plain text files on Grep huge number of patterns from huge file. Many people there said I should, so now I'm migrating my data to a sqlite database: I have a file ...
21
votes
4answers
866 views

Are Linux utilities smart when running piped commands?

I was just running a few commands in a terminal and I started wondering, does Unix/Linux take shortcuts when running piped commands? For example, let's say I have a file with one million lines, the ...
1
vote
4answers
6k views

Can I access Nth line number of standard output?

Assuming a script that outputs a list of files: $> bash someScript.sh path/to/some/file path/to/the/file/i/want/to/work/with path/to/yet/another/file Now I want to have the second file-path as ...
4
votes
2answers
1k views

How to install light-weight vim and to be able to efficiently load files into one instance vim?

On my laptop with Ubuntu I'm able to have just one instance of vim, launched with vim --servername VIM After this I'm able to open files from console with vim --remote-silent filename I use ...
4
votes
1answer
514 views

Efficiency of lots of inotify watches or stat calls

I am developing software that will utilize inotify to track changes on a large amount of files (tens to hundreds of thousands of files). I have come up with these ideas: one watch per file one watch ...
15
votes
3answers
7k views

How do I minimize disk space usage

One of my machines is the 2GB EeePC Surf, a neat netbook with very limited resources. So limited that right now, I have 22MB free space left. On it, I'm running Arch Linux with the Openbox DE and a ...