1
vote
3answers
76 views

Problem when splitting command with backslash in unix prompt

I often use the space-backslash combination ( ) to split a command and its parameters into various lines and make it more readable: /home/user> ls -ltra \ > file1.txt \ > file2.txt ...
4
votes
2answers
144 views

Emacs shell mode makes $PS1 different

I have a custom $PS1 variable that looks like this on my command line: And on emacs using M-x shell unfortunately looks like this: Here is my $PS1 variable export PS1='\[\e]0;\u@\h: ...
1
vote
1answer
198 views

How can I move between words in the command prompt in tcsh in linux?

I want a feature like vim's going forward or backwards command (w,e,ge,b) etc in the shell prompt. I am using tcsh shell in Linux. I would like to go 'n' number of words backs or forward etc and do ...
2
votes
1answer
142 views

How to put “glue” CWD (etc.) to part of the screen instead of putting into PS1?

I suspect there’s some terminology for this question that I’m not aware of. It’s hard to check if a question has already been answered if one doesn’t know the proper vocabulary. So, sorry if this is ...
1
vote
1answer
647 views

When a command is over half the terminal size it breaks

Whenever I type in a bash command longer than about half the width of the shell window I'm in, the command breaks like it would if I filled the whole screen 3rd command in image - typed a few xs ...
3
votes
2answers
5k views

executing if-statement from command prompt

In bash I can do the following: if [ -f /tmp/test.txt ]; then echo "true"; fi However, if I add sudo in front, it doesn't work anymore: sudo if [ -f /tmp/test.txt ]; then echo "true"; fi -bash: ...
2
votes
2answers
279 views

Shell Prompt Customization? [closed]

I have used oh_my_zsh (and tinkered with bash_it) on multiple systems and have generally been happy with it, though I hate it's auto-correction feature and generally turn it off. My usual shell is ...
2
votes
1answer
388 views

There is no bash indicator prompt after a forked process terminates

I am reading the book Advanced Programming in the Unix Environment. There is a test program to test the fork function. It works well in my Ubuntu. But what I confused is that why there is no command ...
5
votes
5answers
325 views

Conflict between my prompt definition and cat in zsh

I have a file on a remote filesystem that I know has a short text string in it (a sequence of numbers in a single line). If I open the file on a text editor like nano or Emacs I can see the string. ...
4
votes
4answers
918 views

Which stream does Bash write its prompt to?

I am trying to redirect all output from bash (prompt, user input, results) to a file Example: /bin/bash > file.txt 2>&1 I thought that would work, but I'm not getting the prompt. Can ...
3
votes
1answer
224 views

ssh behavior for root and non-root user

When I ssh as root to a remote machine, the command output looks like this: root@Machine:/current/path#: However, if it's a non-root user, all I see is: $ How can I get the same behavior as for ...
3
votes
3answers
741 views

Is there a way to make the prompt definition multiline?

This is my current prompt definition: PS1=$'%F{063}%1~%f %(1v.%F{099}%1v %f.)%F{063}%%%f ' RPROMPT='$VIMODE %m' and I'm working on integrating this. Basically I'm starting to find it very ...