All Questions
27 questions
1
vote
0
answers
36
views
Going to the direcory of a file as fast as posible [duplicate]
Is there a way to get to the path of a file as fast as possible and in the least amount of keystrokes.
Context:
Type cd and then paste the path of a file and then have to go back and hit backspace ...
0
votes
2
answers
170
views
In terminal, how to delete a word when cursor is within the word?
I want to achieve functionality similar to c + a + w or d + a + w in vim
In terminal we have Ctrl + w for delete a word in the left and Alt + Backspace from the right But I was not able to find a ...
5
votes
2
answers
994
views
How to execute command after every failed command?
I am trying to log every time a command fails (by sending an HTTP request to my VPS) to see how many times I have messed up.
I've tried: some_command || curl <my-vps>. Is there a better way?
1
vote
0
answers
125
views
can we trigger some action if we `cd` into directory? [duplicate]
I have multiple projects over various languages like JavaScript, Python. I wonder if Linux provides some functionality to trigger some actions automatically if we cd into a particular directory?
For ...
0
votes
2
answers
222
views
Syntax or convention used to describe Linux commands
If you apply git clone --help in the command line, your result will include something like the following:
git clone [--template=<template_directory>]
[-l] [-s] [--no-hardlinks] [-q] ...
-6
votes
1
answer
155
views
the output between zsh and bash
i write this command in zsh
pwd ; ls ; cd /etc ; pwd ; cd ; pwd ; ls ; echo $BASH_SUBSHELL}
/root
Desktop Downloads Music Public Templates
Documents for_play Pictures pycharm Videos
/...
0
votes
2
answers
526
views
Source script with user input
I have a script that is something like
#!/bin/bash
echo -n "User: "
read -e username
echo -n "Password: "
read -es password
export http_proxy="http://$username:$password@...
3
votes
1
answer
657
views
How to do smart backups of terminal history
Trying to implement smart backups of my zsh terminal history (~/.zsh_history). Same goes for bash no difference just the file is called .bash_history.
So far I have decided to create a private git ...
1
vote
1
answer
2k
views
How to set bash default shell for the root user
my shell config was changed to zsh for the root user for some reason. This does not allow me to root user and I do not have another user in sudoers file, can I return the shell configuration to bash ...
0
votes
1
answer
40
views
Awareness of text under prompt?
Continue of this question: here
In 2nd my_processes function:
my_processes() (
for c in sc rc ed cnorm civis; do eval "$c=\$(tput $c)"; done
trap 'printf %s "$rc$ed$cnorm"; ...
1
vote
1
answer
194
views
Real-time output of command that not take up current prompt position?
I have command: ps -o pid,user,%cpu,command | head -n 30
I want to print output of above command and have it updated but keep print out at the same of previous output without refreshing the whole ...
0
votes
2
answers
1k
views
Linux shell command pasting issue
I frequently need to run a script and provide it several lines of STDIN. When doing this, I'll typically prepare the invocations, and then copy & paste them from one terminal window to another. ...
-2
votes
1
answer
650
views
Difference between the shells [closed]
I've been using Linux Mint since March 2020, and I haven't used any shells other than the Bash shell.
So what exactly is the difference between the Bash shell and the other shells (Fish, Zsh, Ksh, ...
0
votes
1
answer
2k
views
Bash coming on zsh, why?
I currently switched to zsh from bash but, when I type wrong command, instead of zsh:<wrong-command>: command not found, comes bash: <wrong-command>: command not found it is something ...
0
votes
5
answers
921
views
What is the canonical way to pause WinCMD-Style in Linux Bash?
In Windows Batch/CMD, to pause the execution of a script, you would use
echo 'This is before pause.'
pause
echo 'The key was pressed, continuing...'
How would this be realised using a standard ...