Windows 10 Bash and Google Chrome with filepath parameter [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I am attempting to use Windows 10 Bash as an alternative to PowerShell, as my requirements towards neither of them are high. As of now I am satisfied with quickly navigating the system and using tools such as grep.
To my question:
At this moment I attempt to open PDF files (or any files for that matter) using the Kali Linux Client of Windows 10. This means I run a Kali Linux Bash in Windows 10 and try opening a .pdf file located at C:\Folder\Subfolder\MyFile.pdf, similar to the way I am used to on my Ubuntu machine. The command does not appear to be working however. The command I use:
root#PC01:/mtn/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe /mnt/c/Folder/Subfolder/MyFile.pdf
Chrome will then open, however skips the file, i.e. it will open the default window. The path of the .pdf does autocomplete, indicating it is correct. For comparison: I can trigger Chrome along with the .pdf file I intend to open passed as parameter with this command:
PS C:\> & '.\Program Files (x86)\Google\Chrome\Application\chrome.exe' 'C:\Folder\Subfolder\Manual.pdf'
This PowerShell command works fine. It will open Chrome and Chrome in turn will open the filepath passed as parameter.
Is the reason this is not working in the Win10 Kali Linux Bash a mistake on my part? Or does Chrome run into trouble trying to interpret the path passed as parameter in the Kali Linux VM (I assume it is a VM, correct me if this is wrong, please), so that it cannot find the specified location?
My attempt to stringify the parameters was not met with success. Also I was able to find information on how to start Windows programs from the Linux bash, however not how to pass a filepath parameter properly, so apologies in advance if I happened to miss something.
Thank you, looking forward to the replies.

Even though you start Chrome through the bash shell, the program itself will not know how to handle the bash-style file path. As it is a Windows based program it will however know how to handle the DOS-style path.
So you can simply use:
/mtn/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe 'C:\Folder\Subfolder\Manual.pdf'

Related

Open a terminal ends in an infinte loop [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
So I've been looking around on the web for some while now but this seems to be a tricky task.
I intended to change my default terminal on a Mint system from gnome to alacrity.
I had alacrity installed before on the same system and it seemed to be work fine.
I have not set up my root user or know the password for it so this makes this extra hard!
To change the default global behavior (e.g. pressing Crtl+Alt+T) modifying the /etc/passwd seemed reasonably to me.
This is what the last line looks now: user:x:1000:1000:User,,,:/home/user:/usr/bin/alacritty
But: If I want to open a shell now almost a thousand instances do appear once the command is triggered and after a short while the whole system crashes.
I don't know how to reset to the default setting since I need a shell and that tool is broken...
Here is what I tried so far
Try to use the shell env available at user log in: Login ends in an infinite loop
Try to open the /etc/passwd in graphical environment: Cannot modify the file (read only)
So here what I wish: Make this undone without reinstalling the operational system.
Thanks for your help and advice!
The field you are trying to change in /etc/passwd is used to set the per user shell (usually /bin/bash on Linux). The terminal emulator you want to use is can either be done with update-alternatives (system wise if you have root) on Debian based systems, or Window Manager specific configuration in general (GNOME, KDE, Xmonad etc).
Login in as root, and change the /etc/passwd file back to using a valid shell for the user in question. Not sure how you don't have a root user. If you don't have the root password then follow the normal password recovery process. Boot from a live or rescue cd. If it doesn't mount the file system for you, mount it manually then edit /mnt/etc/password (where /mnt is where the original file system was mounted). Unmount and reboot your system normally.

Copying and pasting text from windows to a remote linux file [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have an amazon ec2 instance hosting ubuntu 14.04. I need to copy a paste a win 7 textfile on my local machine, into a textfile on ec2. Is there a text editor that would support cutting and pasting available in ubuntu 14.04 or what is the best way to cut and paste info into a linux file . I created the file on amazon using
$ vim text1.txt
Cut and paste are an operation on the local operating system so your remote linux box is not going to support it directly.
That said, your terminal emulation will accept a paste operation (usually with Shift-Insert on Windows if I recall), so you can just go into insert mode in vi and paste - the characters just get inserted as if you had typed them all.
The suggestion to use cat > filename also works but I have found that some terminal emulations will hang when pasting large chunks to the command line where stuffing them into vi has worked fine.

How to open applications after booting a purely Command line interface of Linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
After booting linux in purly command line mode how can I open an application eg web browser or Libra Office?
For example if I use the command "play" with any audio file it starts to play it. I want to know commands for other applications
You have to start an X Window session before you can open those applications because they depend on it to render the GUI. To do this you can use the startx command.
There is a good description here on how to use startx.
However, doing it this way can be a lot of manual and tedious work. That's why most linux distros have packaged full window managers like Gnome, Xcfe, etc for you to install with a single command. If what you really want is a minimal one you might look at Fluxbox or Openbox. You can learn a lot about the guts of X by installing and configuring them on your own.
I suspect what you may really need is just to edit text files and get resources from the internet while logged into a Linux box that is command line only. If so, you can check out these command line only tools.
Lynx command line browser
WGet internet file retriever
EMacs text editor
Vim text editor

AwesomeWM wallpaper change [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
When I am using Awesome-WM under Linux Mint 13 "Maya" MATE, sometimes I need to open the File Manager "Caja". But when I launch caja, the wallpaper changes to the one I set under MATE instead of the one in rc.lua. I have tried
sudo gsettings set org.gnome.desktop.background draw-background false
but it seems useless.
How can I keep my settings under awesome-wm? Or I should set the 2 backgrounds the same?
You could try setting your wallpaper using feh.
Create a .fehbg file in your $HOME and put this in:
feh --bg-scale '/path/to/wallpaper.jpg'
..then save it.
Then in your autostart script just add sh $HOME/.fehbg & then try restarting your DE. If it still persists after opening Caja, then I am not sure about that since I am totally unfamiliar with Caja, rather, I am not familiar with MATE at all.
I think what's happening is that caja is set to 'manage' your desktop. That means it'll change your wallpaper to the one set in MATE, and probably display desktop icons as well, e.g., Computer, Home, etc. This has always been a problem for me when using alternative window managers on Ubuntu, because nautilus does it as well. With nautilus the behaviour can be turned off using the terminal flag --no-desktop. caja seems to be a descendant of nautilus and a quick Google shows references to the same terminal option for it as well. So I suggest you try
caja --no-desktop
and see if that works for you.

cygwin + rsync [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I would like to backup a dir in Win XP on a Solaris server via rsync. I installed cygwin but when I type rsync I get 'command not found'. How can I install rsync? And how can I install ssh. I have installed Poderosa as ssh client (a sort of putty).
run your cygwin setup.exe again, and expand the categories to find 'rsync' and 'ssh'.
Much easier. Run setup, click through to the 'Cygwin Setup - Select Packages' window, and type 'rsync' in the 'Search' box at upper left. At this writing, this shows three lines, one of which is 'Net'. Expand Net and you'll find rsync. Click the circular arrow icon to mark it for install, then click Next at lower right.
You still need to install the rsync package. Run setup.exe again and go through the packages manually (it's probably in 'networking' or 'utilities').
When you run setup.exe, the package selection will be set to "default". You need to click on the top-level circular arrow picture until it says "Install" or "Full" (my memory fails me), it will do this for all sub-packages as well.
The first time you click on it, wait a few seconds - there's a long delay in getting from "default" to the next option.
That's the best way. All the times I've tried to select individual packages, I've had troubles so I've long since gotten into the habit of installing everything.
If all you want is rsync, the BackupPC project (OSS) has a slightly modified version of cygwin's rsync that runs without a full cygwin installation, and can even be installed remotely on PCs with IPC$. http://sourceforge.net/project/showfiles.php?group_id=34854&package_id=88133

Resources