1
vote
2answers
32 views

Excluding a file from UNIX “find” results based on existence of another file

I have a big bunch of directories, each with a series of .pdf files. Some of these files have successfully converted to .csv, some have not. An example directory listing using find ./: ...
12
votes
2answers
655 views

Why does redirecting the output of a file to itself produce a blank file?

Why does redirecting the output of a file to itself produce a blank file? Stated in Bash, why do less foo.txt > foo.txt and fold foo.txt > foo.txt produce an empty foo.txt? Since an ...
0
votes
1answer
137 views

How to extract a specific file without its folder structure using the 7za command

I have a zip file (my.zip) consisting of 4 files: mydata_20050523-20130113.csv mydata_20050523-20130113FileHeader.csv my Data Association - Code Values.pdf my Data Association - Readme.pdf out of ...
5
votes
2answers
4k views

Opposite of tail: all lines except the last n lines

How can I discard the last n lines of a file with a unix command line filter? That would be sort of the opposite of tail: tail discards the first n lines but pipes the rest through, but I want the ...
1
vote
0answers
98 views

pronunciation of 'ctl' in commands like 'systemctl' [closed]

There are sorts of commands like 'systemctl', 'hostnamectl', or 'jounralctl'. I realize that 'ctl' is shorthand for control, but I'm wondering what the generally accepted pronunciation of 'ctl' is.
4
votes
4answers
5k views

awk / sed to print only up to the underscore character

How can I use awk or sed to print a string only up to the first underscore character? Before: host100_044 2 host101_045 2 host102_046 2 After: host100 host101 host102
2
votes
1answer
89 views

Why is `bc` ignoring my `obase`?

>>> bc bc 1.06 Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. ibase = 16 obase = 56 ...
1
vote
1answer
173 views

Identifying a file with “file” in a shell script?

I'm currently writing a shell script that needs to be able to identify the actual type of files (not their extensions) with the unix "file" utility. However, that tool outputs human readable text ...
3
votes
2answers
771 views

why doesn't unix's du(1) command support -i for inode measurement?

Is it simply because going from filenames to inode numbers is difficult in userspace, and you can't read inodes from there?
1
vote
3answers
7k views

How to kill all the processes that have dates older than today?

I issue the command ps -aux | grep tony. It displays the following output tony 10986 0.0 0.0 33532 464 ? S Feb01 0:00 vncconfig -iconic tony 10988 0.0 0.0 86012 512 ? ...