65,961 reputation
863145
bio website
location European Union
age
visits member for 1 year, 7 months
seen 13 mins ago

1d
comment xclip does not change the clipboard content
After echo hi | xclip -sel c, is xclip running or is something else stealing the selection? Can you identify the source of the selection? Do you have a clipboard manager running?
1d
comment xclip does not change the clipboard content
What did you try to say it doesn't work? What's the outcome (something else pasted, nothing pasted when you query the clipboard selection)
1d
comment Combined `mkdir` and `cd`?
Nope, just wait for it to be closed. Do not delete it, as being a different wording, it may still be useful for people searching the same based on terms in your question.
2d
comment Combined `mkdir` and `cd`?
!$ is shorter and easier to type on many keyboards. See also <Alt-.> or <Alt-_>
2d
comment bash_history: comment out dangerous commands: `#`
@MartinVegter, yes, for modified history entries, bash inserts a * after the history number which was not expected. Should be fixed now.
2d
comment Dynamically trim stdout line width in Bash
stty gets the settings of the terminal opened on its stdin (you do stty < /dev/other-tty to get the settings of another terminal for instance). So it's not strange that it won't work if its stdin is a pipe or that <&2 works.
2d
comment Dynamically trim stdout line width in Bash
Some shells like zsh, ksh93 or bash store the terminal width in $COLUMNS
2d
comment Dynamically trim stdout line width in Bash
Try tput rmam; ps aux
2d
comment Remove Linux directories containing ONLY old files
@pk7, if the directories contain only 180+ days (or if the directories are empty), then find will output nothing, then grep will return false, then echo rm will be executed.
2d
comment Remove Linux directories containing ONLY old files
@val0x00ff It removes the directories that do not contain files younger than 180 days.
2d
comment Get bash DEBUG trap to execute only once for and/or lists?
See this
2d
comment Get bash DEBUG trap to execute only once for and/or lists?
Sounds like you want the equivalent of zsh's preexec() hook.
Apr
17
comment Is there a one liner which can list public key fingerprints with authorised_keys as input?
That doesn't work, -f expects a file name (and that file has to be a regular file as ssh-keygen opens and reads the file several times)
Apr
17
comment Want to replace the words with space in multiple files using SED commmand
@danny, use -i (GNU sed) or -i '' (FreeBSD, OS/X) if you want in-place editing but no backup.
Apr
17
comment Find “.git” dirs but ignore some paths; or how does `find -not` work
-path '*/old' is the same as -name old
Apr
17
comment Find “.git” dirs but ignore some paths; or how does `find -not` work
That still descends into the old directories, you may want to use -prune here to avoid that.
Apr
17
comment Want to replace the words with space in multiple files using SED commmand
@Danny, note that the .php files are the backup files (the original) the modified ones are the files themselves.
Apr
17
comment Perform filename expansion on $@
If (wild guess) what you want is absolute paths of those of the positional parameters that are non-empty directories, then that'd be something like $^@(NF:a)
Apr
8
comment Why is this OSX/BSD/GNU sed workaround not working
Or if "$darwin"; then sedi() { sed -i '' "$@"; }...
Apr
5
comment How to make bidirectional pipe between two programs?
If you make it prog2 < fifo0 > fifo1, you can avoid your little dance with exec 30< ... (which by the way only works with bash or yash for fds over 10 like that).