Questions tagged [unix-utils]
33 questions
79
votes
6 answers
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 command to pipe everything through except the last n…
Dr. Hans-Peter Störr
- 2,169
- 4
- 19
- 24
25
votes
5 answers
Flashing window in gnu screen
I really like gnu screen but there is a problem in my environment when I use it.
Examle:
username@domain:/var/www$ l
Display all 130 possibilities? (y or n)
when you click [Tab] to perform autocompletion there is a screen flashing for a very short…
user51940
- 433
- 5
- 8
23
votes
3 answers
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 append such as less eggs.py >> eggs.py produces a two copies of…
seewalker
- 713
- 1
- 6
- 8
18
votes
5 answers
ls: cannot access file: No such file or directory
Context: I added a drive to my machine, and for whatever reason, I am unable to access a directory(?) on it.
ls -l
ls: cannot access Downloads: No such file or directory
total 56
d????????? ? ? ? ? ? Downloads
drwxr-xr-x 26…
Beefy_Swain
- 431
- 1
- 4
- 14
13
votes
6 answers
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
Rubstr
- 131
- 1
- 1
- 3
9
votes
2 answers
How can I change the order of GNU Screen "screens"?
I am currently using the GNU Screen tool. Now my question is whether there is a way to organize or rather change the order of the screens/ screen list displayed at the bottom of my console window. I haven't managed to do this however having my…
appr3ntice
7
votes
0 answers
pronunciation of 'ctl' in commands like 'systemctl'
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.
jlund3
- 517
- 6
- 13
7
votes
3 answers
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?
nick black
- 171
- 1
- 5
6
votes
2 answers
How do I install 'rev' in Cygwin?
The Unix rev utility reverses lines in a file. How do I get this under Cygwin? Which package do I need to install?
Sjoerd
- 1,193
- 7
- 16
4
votes
2 answers
Count lines fast
I'm running Windows 7 and have GnuWin32. I have a several-gigabyte text file with LF (\n) line endings. I want to know how many lines it has (or alternatively how many LFs it has, which is, let's say, one fewer, but I don't care). What's the fastest…
msh210
- 225
- 3
- 15
4
votes
1 answer
why do *NIX commands have such "insane" (counterintuitive) defaults (philosophical pondering)?
Why do most *NIX commands my (experience is Linux mostly and rare encounter with FreeBDS) have such "insane" (unintuitive) default, behaviours, i.e. VERY different from what the "equivalent" GUI action would do.
The most obvious example is the file…
NeuronQ
- 153
- 6
3
votes
1 answer
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
BE753DE5C17F1B6C9F5D1E8A628B74B0FFC4A7
13 54 52 19 83 18 71…
Alan H.
- 2,758
- 8
- 27
- 39
3
votes
1 answer
wget: unrecognized option `--no-check-certificate' on windows
Despite being advised to use --no-check-certificate option with wget, I get this error that the option is not recognized. What do I do?
wget: unrecognized option '--no-check-certificate'
Qwerty
- 453
- 7
- 22
2
votes
1 answer
how to compare contents of video files?
I have many videos with different encoding. I know some of them have the same content. So here's my need: is there a linux tool (command line oriented, with or without graphical front-end, open-source) to compare the content of video files in a…
gildux
- 253
- 2
- 14
1
vote
1 answer
Why does grep -r --include=*.js * > dirname/.filename not write all .js files to a single file?
I am trying to put all js files in a directory and sub directorys into a single file in lexical order. What did I do wrong?
user5448026
- 203
- 1
- 2
- 4