Questions tagged [unix-utils]

34 questions
93
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…
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
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
  • 723
19
votes
6 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
  • 441
  • 1
  • 5
  • 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
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
  • 537
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
8
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?
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,448
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
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
4
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,938
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
  • 586
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
  • 282
2
votes
4 answers

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 ? S Feb01 0:00 twm tony 15553 0.0 0.0 …
Tony
  • 1,093
1
2 3