I like using the cut
command in Linux with the -c
flag. However, I'm interested in finding a command that sort of does the set inverse of cut
. Essentially, given the input:
drwxrwxrwx 2 root root 4096 4096 4 20:15 bin
drwxrwxrwx 2 root root 4096 4096 4 20:15 Desktop
I would like to see everything except “4096 4 20:15”. Here is the output:
drwxrwxrwx 2 root root bin
drwxrwxrwx 2 root root Desktop
I want to be able to literally cut out between characters x and y, if that makes sense.
Any ideas? I can't imagine it'd be a hard script to write but if there already exists a command for it, I'd love to use it.
cut
:cut -c -23,42-
. But actually this is the worst possible idea. See Why you shouldn't parse the output of ls(1) for explanation. – manatwork Sep 8 '13 at 16:31stat
on your system? (Usually is on Linux, its a GNU tool.)stat -c '%A %h %U %G %n' *
– manatwork Sep 8 '13 at 16:35cut
ispaste
, although I see that your question needs just another incantation ofcut
(as already answered). – Wildcard Nov 13 '16 at 9:51