Ubuntu 18 Autocomplete Bug? "bash: cd: too many arguments" - testing

Autocomplete started working bad after upgrading from ubuntu 16. If I hit tab after
git checkout src/
I get something like this:
$ git checkout src/bash: cd: too many arguments
main/ test/
Coincidentally I happened to see the same using the "test" command of gnu-coreutils:
$ ls
pom.xml src target
$ test pom.xml
bash: cd: too many arguments
Are the two things maybe connected? Unfortunately I couldn't find any bug after googling it.

I had the same issue. One of my aliases had the name test, lib or root (I don't remember which one) and it was a cd command to a folder. Renaming the alias solved the problem for me.

My latest alias with .bashrc was with using words like test and git where I was trying to change to corresponding directories. I have changed them to testdir and gitdir and restarted my computer. I don't have this -bash: cd: too many arguments error showing up now.

Related

Find node dependency versions within unexpected directory structure

I have the following directory structure for a project I'm working on:
application
package.json
client
package.json
server
package.json
Additionally, some of the dependencies used in the project have a similar client/server hierarchy with a base-level package.json. The reasoning here is beside the point. What I'm trying to do is find the installed version(s) of a given lib within this project wherever it may be getting pulled in. I had hoped npm ls would do this, but it appears to only inspect the base-level package.json files.
I'm considering writing a bash script or something that recursively finds all node_modules directories starting in the root directory and then using npm ls in each directory, but am also hoping to find an easier answer. Any thoughts would be appreciated.
I ended up defining an alias as follows:
alias npm-ls-lib='_npm-ls-lib(){ \find . -type d -name "$1" -exec npm --prefix {} ls . \; | grep -v \(empty\); }; _npm-ls-lib'
and now I can call it like this: npm-ls-lib lib-name

Flatpak Intellij Idea - problem with subversion executable

After installing Intellij Idea using flatpak on Clear Linux I'm not able to make it run svn executable.
I added ---filesystem=host to flatpak permissions and tried to set executable path to /run/host/usr/bin/svn but with no luck (path is available/exists, though Intellij keeps complain)
svn command is normally available from system terminal.
When I try to run /run/host/usr/bin/svn command via Intellij Idea built-in terminal, I've got error that library is not available:
sh-5.0$ /run/host/usr/bin/svn
/run/host/usr/bin/svn: error while loading shared libraries: libsvn_client-1.so.0: cannot open shared object file: No such file or directory
I also tried set flatpak-spawn. Following command works perfectly fine in Intellij Idea built-in terminal:
/usr/bin/flatpak-spawn --host /usr/bin/svn, though when set as path to svn executable still gives me Intellij Idea error:
"The path to Subversion executable is probably wrong"
Could anybody please help with making it work?
TLDR: You probably need to add the path to svn into your IntelliJ terminal Path.
Details:
It looks like you are having a path issue. I had a similar problem running kubectl running PyCharm installed from a flatpak on Pop_Os.
If I try to run kubectl I see the following:
I have kubectl installed in /usr/local/bin. This is a screenshot from my 'normal' terminal.
In the PyCharm terminal this location is mounting under /run/host/usr/local/bin/.
If I look at my path in the PyCharm terminal, it is not there.
So I'll add the /run/host/usr/local/bin/ to my path and I can then run kubectl:
To make sure this comes up all the time, I need to add the PATH to the Terminal settings:
I can now execute any of the commands in my /usr/local/bin dir.
I found a really ugly solution for dealing with SVN with the JetBrains family, which does actually answer the question. But in a very roundabout way. Unfortunately Alex Nelson's solution didn't work for me.
You would think the Flatpak would come with a valid SVN, since it's actually part of the expected requirements for the program...
When in the terminal, you can run
cd ..
/usr/bin/flatpak-spawn --host vim ./svn
Then press i to go into input mode, then paste the following in the opened text file (Basically what it does is create an executable which passes it to the flatpak-spawn invocation):
#!/bin/bash
/usr/bin/flatpak-spawn --host /usr/bin/svn $#
Save and quit from vim (ESC, then :wq!). Make it executable:
chmod +x svn
Then in IntelliJ's menu, set the "path to svn" to
/home/<yourusername>/IdeaProjects/svn
It's worked for everything I've tried... Hope this helps out anyone else who was struggling with this.
I am using a similar solution to caluga.
#!/bin/sh
cd
exec /usr/bin/env -- flatpak-spawn --host /usr/bin/env -- svn "$#"
exec makes it replace the wrapper script process so the wrapper script process can end.
I'm using /bin/sh instead of /bin/bash as bash features are not needed.
using /usr/bin/env, but maybe not necessary if PATH is set up right.
remember to quote "$#" in case there are spaces in arguments.
I am putting it in ~/.local/bin and referencing it with its absolute path in the IntelliJ settings (Settings -> Version Control -> Subversion -> Path to Subversion executable).
I also was running into problems with IntelliJ saying that /app/idea-IC path does not exist. Figured that something outside the flatpak (i.e. svn or env) was trying to change directory to the working directory from where the wrapper script was invoked (inside the flatpak). Using cd allows the wrapper script to change to a directory that exists both inside the flatpak and on the host.
Fedora Silverblue or toolbox users might want to use dev tools inside their toolbox, in which case you can do:
#!/bin/sh
cd
exec /usr/bin/env -- flatpak-spawn --host toolbox run svn "$#"

SSH opening file error - no idea why

Running Debian Linux - newest version.
cp /included/filename /usr/bin/
It gives me error "cannot stat '/included/filename': No such file or directory
I don't get why there should be an error. I am doing it as superuser.
From your latest comment i conclude you got the paths mixed up. If you want to copy the file install.sh located under /usr/bin/included/ you would need to do
cp /usr/bin/included/install.sh /usr/bin/
to make something similar to your provided command work, id assume you are in /usr/bin and the first argument needs to be a relative one
cd /usr/bin
cp ./included/install.sh /usr/bin/
Please provide more information on what you are trying to do and provide realworld example code.

How do I remove CLion-2016.2.3 completely from Ubuntu 16.04 LTS?

I had installed CLion(2016.2.3) IDE from CLion-2016.2.3.tar.gz file. I accidentally deleted the CLion-2016.2.3.tar.gz file and CLion-2016.2.3 folder(which I got after extracting CLion-2016.2.3.tar.gz). Now CLion isn't working. When I ran dpkg --list from terminal, CLion wasn't present in the output. I want to remove CLion completely(all its files, folders, dependencies, etc.(even the configuration files)). How do I remove it completely?
Run the following command in terminal to find all the directories and files containing clion in their name :-
$ sudo find . -iname "*clion*"
Then delete the directories and files you have found.
To delete directories/files, go to the location of that directory/file in terminal using cd and run the following command :-
$ sudo rm -rf DIRECTORY_NAME/FILE_NAME
Simple Steps are :
Delete the clion folder you have downloaded and extracted.
Remove cache in ~/. using the command : sudo rm -r ~/.Clion.
Also need remove settings: /home/user/.config/JetBrains
You need also to remove settings that are stored in ~/. directory. That's it for Unix/Linux.
All Clion's binaries are store inside the folder you deleted.
But Clion sets up preferences at first launch, and you may have a menu icon which is pointing nowhere.
I suggest you run something like find ~ -iname "*clion*" and investigate what is found. If you are using Gnome2 or MATE desktop you will certainly find .desktop files which are the icons you are looking for.
If you used snap to install you can uninstall using
sudo snap remove --purge clion

Bower not found when Running JHipster

I had some issue recently and the problem seems to be very badlty documented so I make here a post to explain it and the solution as well.
When running JHipster and do all the installation step, you may have some issue running the ./gradlew bootRun (bootRun is not necessary as it is the task by default).
If you have the following problem :
You CAN'T solve it with sudo. I don't really now why, but the console will logged you that you don't need sudo to run that (really frustrating).
You can find the solution in the comment (It seems that I have to separate the question from the answer).
The actual problem is that the file you can't run has the wrong username or group name and can't be ran due to that.
So you have to change it by the command :
chown -R
The syntax is :
chown -R Username:groupName path/of/your/file
But then the question is : How to know what to write in username and groupName ?
You have to go to your directory (where you run ./gradlew ) and type :
ls -l
It will show you all the files in the directory, with the username and group name associated.
The username is in column 3 and group name in ** column 4** .
Normally, this should be all the same here. But that's quite normal : The problematic file is not here. But you have here the name your problematic file should have.
Just run the command and this should work !