gnu-coreutils

Linux API Calls to implement rm, mv, and cp [closed]

丶灬走出姿态 提交于 2021-01-20 12:00:53
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . Improve this question I'm writing my own little shell in C, or at least I'm going to start today. I want to implement three functions. remove file1 What system calls would I need for this? Just open file and delete its contents or is there a system call to delete a file besides

Why ln -sf does not overwrite existing link to directory [closed]

人盡茶涼 提交于 2021-01-20 09:39:09
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Improve this question According to documentation, command ln -f removes existing destination file. Does this mean that if I create a symlink, -f should remove of overwrite any existing symlink at destination? I have a symlink, say, L, pointing to DIR1 and type ln -sf DIR2 L . But L

install symbolic links with coreutils install

流过昼夜 提交于 2020-08-27 04:26:34
问题 I built a library and I want to install the library to /usr/local/lib using coreutils install . The result of the build looks as follows: libfoo.so -> libfoo.so.1 libfoo.so.1 -> libfoo.so.1.1 libfoo.so.1.1 I want to retain the symbolic links and install the files as is to /usr/local/lib . However, if I run install libfoo* /usr/local/lib the symbolic links are resolved and /usr/local/lib looks as follows: libfoo.so libfoo.so.1 libfoo.so.1.1 In other words, these are all real files and no

install symbolic links with coreutils install

夙愿已清 提交于 2020-08-27 04:26:14
问题 I built a library and I want to install the library to /usr/local/lib using coreutils install . The result of the build looks as follows: libfoo.so -> libfoo.so.1 libfoo.so.1 -> libfoo.so.1.1 libfoo.so.1.1 I want to retain the symbolic links and install the files as is to /usr/local/lib . However, if I run install libfoo* /usr/local/lib the symbolic links are resolved and /usr/local/lib looks as follows: libfoo.so libfoo.so.1 libfoo.so.1.1 In other words, these are all real files and no

Why is my Rust version of “wc” slower than the one from GNU coreutils?

时间秒杀一切 提交于 2020-07-18 05:06:07
问题 Consider this program: use std::io::BufRead; use std::io; fn main() { let mut n = 0; let stdin = io::stdin(); for _ in stdin.lock().lines() { n += 1; } println!("{}", n); } Why is it over 10x as slow as the GNU version of wc? Take a look at how I measure it: $ yes | dd count=1000000 | wc -l 256000000 1000000+0 records in 1000000+0 records out 512000000 bytes (512 MB, 488 MiB) copied, 1.16586 s, 439 MB/s $ yes | dd count=1000000 | ./target/release/wc 1000000+0 records in 1000000+0 records out

brew install coreutils failing 10.9.5 OSX

你说的曾经没有我的故事 提交于 2019-12-30 12:13:51
问题 It has been 2 days that I have failed to install coreutils . Last 15 lines from /Users/Mehdi/Library/Logs/Homebrew/coreutils/03.make: src/ginstall -c -m 644 'man/unlink.1' '/usr/local/Cellar/coreutils/8.27/share/man/man1/gunlink.1' src/ginstall -c src/uniq '/usr/local/Cellar/coreutils/8.27/bin/./guniq' src/ginstall -c -m 644 'man/vdir.1' '/usr/local/Cellar/coreutils/8.27/share/man/man1/gvdir.1' src/ginstall -c src/unlink '/usr/local/Cellar/coreutils/8.27/bin/./gunlink' src/ginstall -c src

How do locales work in Linux / POSIX and what transformations are applied?

﹥>﹥吖頭↗ 提交于 2019-12-29 05:20:43
问题 I'm working with huge files of (I hope) UTF-8 text. I can reproduce it using Ubuntu 13.10 (3.11.0-14-generic) and 12.04. While investigating a bug I've encountered strange behavoir $ export LC_ALL=en_US.UTF-8 $ sort part-r-00000 | uniq -d ɥ ɨ ɞ ɧ 251 ɨ ɡ ɞ ɭ ɯ 291 ɢ ɫ ɬ ɜ 301 ɪ ɳ 475 ʈ ʂ 565 $ export LC_ALL=C $ sort part-r-00000 | uniq -d $ # no duplicates found The duplicates also appear when running a custom C++ program that reads the file using std::stringstream - it fails due to

GNU ls from Coreutils missing OS X ACL implementation

别来无恙 提交于 2019-12-23 02:41:48
问题 I'm using brew to retrieve and install common GNU versions of terminal commands and utils with brew install coreutils . Then in my .bash_profile I'm including their PATH with if [ -d $(brew --prefix coreutils)/libexec/gnubin ]; then PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH" fi so far so good, I can use use the GNU version of coreutils. The problem comes from ls . Apple implement ACL that is not implemented on GNU ls . I discovered this by banging my head many times and not

Where are info document files in Mac or in Linux, and how can I install some missing info files?

跟風遠走 提交于 2019-12-22 14:41:24
问题 I wanted read coreutils info, but I could not find it. Now, I wonder where the info documents in my computer (mac or linux). I want to know how I can install info files. Thank you, SangChul 回答1: I suppose you entered info coreutils on the command line, which returned the info top directory instead of the coreutils info page? In that case, here is what I would do (on ubuntu 15.10, and probably on any GNU/Linux OS). Download the coreutils info document from the gnu project: wget http://www.gnu