2,703 reputation
316
bio website none
location Massachusetts
age 40
visits member for 2 years, 5 months
seen Sep 19 at 21:38

Aug
12
comment Is there any in-built Linux command to display the contents of a directory in real-time?
Not quite built-in, but the inotifytools package uses Linux's inotify feature to allow watching file creation events as they happen.
Aug
6
comment In tmux, can I get `exit` to exit the containing terminal window and not the session itself?
Why? You're trying to override the shell built-in exit to not exit a shell. Anyway, as long as you have tmux be the actual command that the terminal runs (as opposed to starting tmux as a child of a shell started by the terminal), detaching will cause the last program running in the shell to exit and, assuming your terminal is configured to do so, automatically close the window.
Aug
6
comment In tmux, can I get `exit` to exit the containing terminal window and not the session itself?
exit is not a tmux command; it's a shell command. tmux only exits if you terminate the command (usually, a shell) in the last pane of the last window. It sounds like you just want to detach from the current session, in which case you should use the appropriate tmux command or key binding.
Aug
3
awarded  Nice Answer
Jul
17
awarded  Nice Answer
Jul
10
awarded  Student
May
21
comment Bash Prompt : incorrect time displayed
@MarcDenisSimard PS1='\n[\D{%d-%m-%Y}] \u@\h [\t]\n{\w} [\!] \# ' works for me. \D should be documented in the same list under PROMPTING in the man page as the other special characters.
May
15
comment Bash Prompt : incorrect time displayed
You can also use \D{%d-%m-%Y} instead to display the current date.
May
15
revised Bash Prompt : incorrect time displayed
added 4 characters in body
May
15
comment Bash Prompt : incorrect time displayed
Unrelated, but you'll need to use single quotes to ensure that date is run each time your prompt is displayed. As is, date is run when you assign to PS1, and your prompt contains the hard-coded date when it was defined.
Apr
25
awarded  Enlightened
Apr
25
awarded  Nice Answer
Apr
14
comment Split a file into two files at a given line
There is a slight chance that head will read more than just 100 lines in order to find the first 100 lines to output to f1.txt; those extra bytes will not be seen by cat.
Apr
7
answered Using \r in bash PS1
Apr
7
comment Terminal's bin/bash not responding
Be aware that /usr/local/bin/bash was probably a new version than the version 3.2 that ships as /bin/bash, so there is a slight chance of some compatibility issues for scripts that assume behavior specific to bash 3.2. This should not be a problem for system scripts, as I think the different versions of bash behave identically when invoked as /bin/sh.
Apr
7
comment How to create a directory named '-p' under Linux with Bash?
Shouldn't, then, the question be "How to delete a directory named '-p' under Linux with Bash"?
Apr
2
awarded  Yearling
Mar
16
awarded  Tumbleweed
Mar
11
comment Different /bin/sh for a specific user
More accurately, /bin/sh is usually not the Bourne shell itself, but a link to another shell which adheres to the POSIX specification, which itself is based on but not identical to the original Bourne shell.
Mar
11
revised input from shell in bash script
added 3 characters in body