I found a file in my terminal named ~$E THINKERS.docx, I tried to removed it using the rm command but it keeps telling me no such file found. I think its a rootkit, since my antivirus doesn't detect it. Anyone can help me remove it?
Your question is lacking details...
I suppose you are working in Unix-like terminal and typing: rm ~$E THINKERS.docx and the expansion fail (look for "Tilde Expansion" in bash(1)).
Could you try: rm '~$E THINKERS.docx'?
If it were a rootkit, you most probably wouldn't see it...
Related
I'm having a frustrating, but seemingly simple problem. I was recently pushing some files to github and now ls has started listing directory contents recursively when I use the basic command ls. Though, it only appears to do so in my Google Drive folder. It functions normally when used in directories outside of Google Drive. I'm not sure if it is connected to something I was doing with git or completely unrelated. I had been working on a github project in my Google Drive when I noticed the issue.
The output of type ls in the Google Drive directory and outside of it is:
ls is hashed (/bin/ls)
Does anyone have any input on how I can get ls to function 'normally' again? I'm not sure how I could've changed its function but it appears I must have. Let me know if there is additional information that would help in understanding the problem.
Thank you in advance
Your ls might be aliased (perhaps in your ~/.bashrc; look inside file that with your editor) by your interactive shell (or it might become a bash function). Check with type ls (using the type builtin).
Use \ls or /bin/ls to get the real ls program.
If your shell is bash, be sure to read the chapter on bash startup files.
Try also using stat(1) and/or some other shell (e.g. zsh, sash, ...).
SOLVED:
I'm not sure why this was occurring, but the issue seems to be related to having updated a Shiny app through rsconnect() in R. I closed RStudio and now the ls command is working properly again in all directories. I have no idea why this would occur and didn't think that would be related at all. Thanks for the troubleshooting help!
Recently I installed Zshell instead of Bash. During this, then I saw that my $PATH was 7 miles long, - so I decided to try and clean it up a bit. When I uninstalled rvm (by running rvm implode followed by rm -rf ~/.rvm) then when I restarted my terminal, I now see an error:
If I just press ENTER, then the error remains. But if I do any other command, then it disappears (ls, echo, source ~/.zshrc - you name it).
If I reboot iTerm (or start a new tab), - then the error re-appears.
The error is not being showed, - so if I activate another theme, then I can't see if there is an error.
My gut feeling tells me, that it has something to do with my path, but I'm not sure. My path is waaay shorter than before RVM was installed.
If i rename my ~/.zshrc-file, then the Powerline9k-theme gets deactivated, so I can't see if the error actually still appears or not. But I have tried it... Then a theme-less zshell just start up.
Any idea how to fix it or how to debug it?
EDIT
I just realized that it could actually have been a left-over-error, from back when I was running bash, - so I added that tag as well.
If the visual blemish disappears as soon as you execute any command as you say so, just place an echo -n at the end of your .zshrc as a quick and easy fix, if you are not up to the task of debugging and potentially causing more problems on your machine.
The issue isn't worth your time ;)
Edit: Apparently the above didn't work. See comments.
If you are interested in debugging, a good starting point would be to place set -xe (print every line that is executing and abort on any line that exits nonzero) at the beginning (after the shebang line, or as flags in the shebang) of each configuration script that is executed when you start a new interactive shell.
Also consider set -xeuo pipefail to additionally catch and abort on usage of unset shell variables and commands that return nonzero inside pipes (e.g. set -e will not abort on false | true because the overall line exited with status 0, but -o pipefail will abort on such a line). It is worth noting that these flags are bash features, but since zsh is a feature superset of bash, they work in zsh too.
Have look at their documentation on github, relevant fragment is here.
Solution:
In your ~/.zshrc find variable called POWERLEVEL9K_LEFT_PROMPT_ELEMENTS and remove rbenv.
Explanation:
The default value of POWERLEVEL9K_LEFT_PROMPT_ELEMENTS is (context dir rbenv vcs), and it is likely that rbenv is the segment producing the error - after you uninstalled rvm that segment can't execute.
Uninstall all apps that use the path and reinstall. It's the only way. Instead of rm, you use should create an alias that has a trash can.
Whenever I start up Terminal on my Macbook Air, I get this message:
-bash: ≈: command not found
How do I fix this error? I'm running Mavericks version 10.9.4 if that helps at all.
EDIT: Fixed this error by using the bash -x method, found out it was a random '≈' character left in ~/.profile that needed to be deleted. Thanks for the answers :)
To debug you can try this:
bash -x -l
(the -l might not be needed).
I definitely agree with Barmar, there is something in your bash startup scripts.
There is not a great way to do this, but here is the protocol to remedy it.
Confirm it is your bash profile by first killing the process with a control + C if it is hung. Then do a source ~/.bash_profile and see if you get that same error.
Backup your bash profile cp ~/.bash_profile bashprofile.txt
Then comment out part of your bash profile. With text wrangler you can do a command + slash.
Save, then do a source ~/.bash_profile and see if the error still prints.
Repeat with different areas of the script until you have isolated the infected region.
When using the latest ZSH and RVM on Mac OS X 10.7.4 ZSH complains about this:
__rvm_cleanse_variables: function definition file not found
Running the following solved the problem:
rm ~/.zcompdump*
Note: The * is incase there are multiple .zcompdump files.
Sometime there is also ~/.zcompdump-<COMPUTER NAME>-<VERSION> file, so use:
rm -f ~/.zcompdump*
To disable the .zcompdump* file(s), you could look in your .zshrc (or /etc/zsh/* files) for compinit and add the -D flag.
This might be better than creating the files and deleting them at every login.
(source: http://www.csse.uwa.edu.au/programming/linux/zsh-doc/zsh_23.html)
My problem persisted even after the compinit -D and rm -f ~/.zcompdump*. I found this github issue and checked my .zplug directory and sure enough found some non-hidden zcompdump files (no preceding '.'). Deleted those and I was good to go. If you're using a zsh plugin manager like zgen or zplug, check their directories.
Add rm -f ~/.zcompdump{,.zwc} to .zlogin to automate it
In bash, environmental variables will tab-expand correctly when placed after an echo command, for example:
echo $HOME
But after cd or cat, bash places a \ before the $ sign, like so:
cd \$HOME
If I use a variable as the second argument to a command, it won't expand at all:
cp somefile $HOM
What mysterious option do I have in my .bashrc or .inputrc file that is causing me such distress?
What you're describing is a "feature" introduced in bash 4.2. So you don't have any mysterious option causing you distress, but just "intended" behaviour.
I find this very annoying since I preferred it the way it used to be and haven't found any configuration options yet to get the earlier behaviour back. Playing with complete options as suggested by other answers didn't get me anywhere.
Try complete -r cd to remove the special programmatic completion function that many Linux distributions install for the cd command. The function adds searching a list of of directories specified in the CDPATH variable to tab completions for cd, but at the expense of breaking the default completion behavior.
See http://www.gnu.org/software/bash/manual/bashref.html#Programmable-Completion for more gory details.
For the second instance, you can press ESC before tab to solve it.
I don't know the solution to your problem, but you could look in /etc/bash_completion or the files under /etc/bash_completion.d to determine what commands use autocompletion and how.
help complete
Might also be helpful.
The Bash Reference Manual has more information than you might want on expansion errata.
Section 8.7 looks like it would be the place to start. It give information on the 'complete' function, among other things.
Check the answer for
https://superuser.com/questions/434139/urxvt-tab-expand-environment-variables by Dmitry Alexandrov:
This is about direxpand option. $ shopt -s direxpand and $FOO_PATH/ will be expanded by TAB.
I'm answering 4-year-old question! Fantastic!
This is a bash bug/feature which was unintentionally introduced in v4.2, and was unnoticed for a long period of time. This was pointed out by geirha in this tread. Confirmed as unintended feature here
I came across this problem when running Ubuntu at home. At work I have bash-3.00, so I've spent some time browsing around to see what's going on. I wonder if I can 'downgrade'....