Skip to main content

All Questions

Tagged with
3 votes
2 answers
697 views

How to limit the number of files printed by ls and print them in columns like ls prints normally?

Here is extension of the question: How do I limit the number of files printed by ls? with additional condition: how to print results in as many columns as fit to the current terminal width — as ls ...
Anton Samokat's user avatar
0 votes
1 answer
55 views

Is the idea of having a login shell and a non-login shell merely a way of making user preferences? [duplicate]

Scouring the internet about the difference between a login shell and a non-login shell, it turns out that the ultimate difference is merely the files that are being sourced. A login shell sources some ...
JLC's user avatar
  • 327
0 votes
3 answers
116 views

Play sound after command and also pipe output

I can easily pipe the output of a command like: some_command | less I can also easily play a sound after a command like: echo test; print \\a aplay, beep or others could also be used for sound. ...
Luis's user avatar
  • 101
1 vote
0 answers
102 views

Shell: Customizing the "Display all N possibilities? (y or n)" message

I already know that double-pressing the Tab key on Bash terminal will enlist all files and folders in the current working directory or, when appropriate, show Linux executables that I can run. I want ...
groaking's user avatar
1 vote
0 answers
325 views

Bash terminal lagging one input behind

After a recent update, I've noticed that working on any terminal for more than a few minutes causes a delay between inputting a keypress and seeing it reflected on the screen. Specifically, if I were ...
Nick Reed's user avatar
  • 173
6 votes
1 answer
637 views

Order of shell expansions: command substitution versus arithmetic expansion

Consider the following snippet being entered at the command line in bash: $ echo $(( $(wc -l letter.txt | cut -c1-4)/66 + 1)) Supposing letter.txt exists and has 66*4 lines, then this puts the string ...
EE18's user avatar
  • 253
1 vote
2 answers
5k views

How to run the command "sudo sh /path/to/script.sh" by double clicking?

I have a question from this thread How to run a bash script by double clicking by entering the path in sudoers?. Since it was explained to me that it is unsafe to grant sudo privileges to the script....
moninah's user avatar
  • 15
0 votes
1 answer
181 views

Calling vim in subprocess after running cat

I am trying to create a bash function vim_run which operates as follows: user pipes command output into vim_run user can edit output user exits vim and the contents of that buffer are now executed ...
zbs's user avatar
  • 3
-1 votes
1 answer
88 views

`IFS="value" command` is a popular feature of many shells, but official documentation is hard to find. Where is it documented officially? [duplicate]

I constantly see IFS="value" command being referred to as a means of changing the IFS (Internal Field Separator) temporarily, only for the duration of the command provided, yet there are ...
Befitting Display Name's user avatar
1 vote
1 answer
75 views

Separate variable scope spawning commands under job control

Is is possible in bash - or other sh-derivative shell - to run in the foreground from command-line a list of commands that have their own variable scope (so any values assigned to variables in that ...
S P Arif Sahari Wibowo's user avatar
4 votes
1 answer
2k views

Shortcut to jump between words/phrases separated by spaces in a terminal

When we write commands especially long ones, we sometimes need to make edits. For example imagine: docker run --rm --name My_container_3.19.2.9-999_khbdabshs --entrypoint bash registry.me.com:2001/...
Dante's user avatar
  • 141
6 votes
3 answers
1k views

Add an item to a list of piped items

I need to add items to a list of items. I am not sure if these are the correct terms. Example: Suppose I am inside a directory with 2 files, "a" and "b". If I pipe ls to less my ...
Lawrence's user avatar
  • 329
1 vote
2 answers
6k views

How can I create a hash or sha256sum in Bash using multiple sources or inputs? What is the recommended method?

I want to create a hash of more than one source in Bash. I am aware that I can: echo -n "STRING" | sha256sum or sha256sum [FILE] What I need is: STRING + FILE FILE + FILE STRING + STRING ...
ReflectYourCharacter's user avatar
2 votes
1 answer
455 views

notify-send with stderr in notification body if there is stderr

Suppose I have a command like: foo() { echo a echo b >&2 echo c echo d >&2 } I use the following command to process stdout in terminal but send error via notify-send foo ...
Ahmad Ismail's user avatar
  • 2,978
0 votes
1 answer
1k views

How to make bash commands a specific color

I have my bash prompt on one line colored green with file path in blue. When I type a command it appears on the next line. After I press enter the output appears on the next line(s). Then there is an ...
user3425506's user avatar

15 30 50 per page
1
2 3 4 5
12