Reputation: 103
Is it possible?
For example, say I want to run the command ll
:
My output would look something like this:
josh@zeitgeist ~ ll
total 41148
drwxr-xr-x 42 josh josh 4096 Aug 4 22:52 ./
drwxr-xr-x 4 root root 4096 Jul 9 21:18 ../
-rw-rw-r-- 1 josh josh 3523718 Jul 11 00:17 2017-07-11-001710_3840x2160_scrot.png
but I want it to look like this:
josh@zeitgeist ~ ll
XXXtotal 41148
XXXdrwxr-xr-x 42 josh josh 4096 Aug 4 22:52 ./
XXXdrwxr-xr-x 4 root root 4096 Jul 9 21:18 ../
XXX-rw-rw-r-- 1 josh josh 3523718 Jul 11 00:17 2017-07-11-XXX001710_3840x2160_scrot.png
I already know about using PS1='XXX'
to change the prompt; is there a way to change every line of the output that gets displayed, specifically in the terminal(not changing the output and putting it in a file)?
I would like to do this to have a unified line of characters going down the left side of my terminal.
Upvotes: 1
Views: 397
Reputation: 20022
Prepend XXX
to all lines including empty lines.
ll | sed 's/^/XXX/'
Edit: After changing your PS1 you can invoke the solution for all commands using
bash | sed 's/^/XXX/'
Upvotes: 1
Reputation: 1109
You could do something like this I suppose:
while read; do echo "xxx $REPLY"; done < <(ls -l)
Not really sure what the purpose of this would be though.
Upvotes: 0