General :: Setting Default Application For Text Files In Bash?
Apr 5, 2011
I want to tweak my linux environment so that when I type a text file name on the command line and hit enter the file should be opened in Vim.
$: /tmp/file.txt
should open the file in Vim. This is similar to what happens on windows (where a text file is opened in notepad.)
View 6 Replies
ADVERTISEMENT
Sep 12, 2010
How is it possible to change the default text that is displayed on the default BASH logon (attached)?
View 1 Replies
View Related
Jun 30, 2011
I want to change the application that opens my mp3 files.
At present if I double click an mp3 it opens in the movie viewer for some reason. I know I can use "open with..." to get a file to open in Rythymbox instead, but I have over 800 mp3 files and want to change the default for all of them.
View 1 Replies
View Related
Jul 13, 2010
I'd like to set Vim as my default text editor (so it opens when I click a file). How can I do this?
View 9 Replies
View Related
Oct 9, 2009
I have a script almost working except for 1 thing. What I'm trying to do is read a file that has the files that need to be FTP'd using a bash script. I have everything working except the reading of the file. It works outside of the ftp script I've wrote but once I put it in the FTP script it doesn't.
Here's the Script:
#Here's where the problem is that I know of
I've been playing w/ the exclamation points to see if that could be the problem, but so far no luck.
View 6 Replies
View Related
Aug 22, 2010
When I click on my .rtf files I get the run or display option, which I really don't understand the difference.
What I am hoping for is for all my .rtf files to default to open office.
View 6 Replies
View Related
Feb 4, 2016
i cannot seem to find a proper way to make Java my default application to open .jar files. I just made a new Debian 8.3 install on my laptop HP Pavilion G6 and the default application for opening .jar files is the Archive Manager. But when i go to "Open with.." section on right-clicking the .jar file, i get no JRE or JDK option to choose. I just installed the openjdk 7. I can manually run them from the bash, but it would be much more convenient if i just double-clicked it. Here is what i get when i run several commands in the bash :
1) which java ->Code: Select allĀ /usr/lib/jvm/java-7-openjdk-amd64/bin/java
2) java -version -> Code: Select alljava version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-1~deb8u1)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
3) echo $PATH: Code: Select all/usr/lib/jvm/java-7-openjdk-amd64/bin:/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin: /usr/local/ sbin:/usr/local/bin:/ usr/ sbin:/usr/bin:/ sbin:/bin
4) javac -version : Code: Select alljavac 1.7.0_95
View 4 Replies
View Related
Jul 22, 2010
AKA "zipping on the fly .. the slow-as-molasses way." The list includes full pathnames to each file, and they're all in subfolders of the same parent folder (which, unfortunately, is not the root folder of the drive or system on which the files reside). A cleaned-up and radio-ready portion of the list looks like
Quote:
.../taiga/ahqr-va-choyvp/bv0884-073.jpg
.../taiga/ahqr-va-choyvp/bv2635-073.jpg
.../taiga/ahqr-va-choyvp/bv3067-175.jpg
[code]....
What I'd like to be able to do is zip all the files in the list into a single archive, to avoid the step of having to copy them to the same location (presumably another folder on the HD) and then zip that folder. I'm more inclined to make provisions about extracting to a single folder at some other time. Is this possible in BASH, or would I have to consider a faster, more robust scripting language such as python or perl?
View 8 Replies
View Related
May 29, 2011
PI'm trying to write a script to list all open ports in the MINIUNPND chain in iptables and use the procotol, port and destination ip to open ports on another router using upnpc.Here is the output of iptables -L MINIUPNPD
Code:
>iptables -L MINIUPNPD
Chain MINIUPNPD (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere 192.168.3.124 tcp dpt:19955
ACCEPT tcp -- anywhere 192.168.3.124 tcp dpt:20054
ACCEPT tcp -- anywhere 192.168.3.130 udp dpt:10654
ACCEPT tcp -- anywhere 192.168.3.121 tcp dpt:29955
code....
No matter what i do i cant seem to remove the first 4 characters from the MYPROT array to leave only the digits. Also i cant seem to read the array back???
I thought it would simply be a loop reading each line and passing the fields in variables, executing upnpc commands i need then moving to the next line of the file until it reached the EOF.
View 12 Replies
View Related
Jan 15, 2010
may be an advanced question but I need to know how to do this. Here at work I am in charge of recruiting and we have about 1,000 resumes in already. All of the resumes are in a .pdf format. I need to rename every .pdf in the following format:{firstnameLastname}.pdfThe only way I know how to do this is to convert all the .pdf files to text, extract the name out of the first few lines of text, import into excel, and then use VBA to rename the files in mass:Here is my logic so far:~Deskop/a = houses all the .pdfresumesOpen terminal: Code: cd ~/Desktop/afor f in *.pdf; do pdftotext -raw $f; done That will convert all of the preceding resumes into text filesNow I would like to append the name of the text file into the last line of the text file. So, for example, for Resume1.txt, I want to append "Resume1.txt" to the last line within Resume1.txt. So after I run the command I open Resume1.txt and on the last line within I want to see "Resume1.txt" on the last line, at the end of the resume.How can I do this? I would like to use a loop and have the terminal append the filename to the body of the text file until all of the have been appended.
View 1 Replies
View Related
Apr 21, 2010
Currently, when I'm searching text in files of my PHP project, I use this line :
Code:
grep -r 'myTextToFind' *
But now, I would like to search only in ".lang" files. How can I do that ?
View 7 Replies
View Related
Feb 10, 2011
I'm running and XP virtual machine using KVM / QEMU. THere are time when I need to copy text from an application in the Fedora host machine and paste the text into a different app in the XP guest machine. I was able to do this using Vitualbox on an earlier version of Fedora.
View 1 Replies
View Related
Jan 22, 2010
I have 2 text files : file1.txt and file2.txt
cat file1.txt
15 this is a sentence containing various words and spaces
34 this is a another sentence containing various words and spaces
cat file2.txt
2 this is sentence1file2
6 this is sentence2file2
54 this is sentence3file2
I would like to join these 2 files. The result should look as follows :
cat joinedfile.txt
2 this is sentence1file2
6 this is sentence2file2
15 this is a sentence containing various words and spaces
34 this is a another sentence containing various words and spaces
54 this is sentence3file2
==> so the joined file must be sorted on the first number. Any ideas how this can be achieved ?
View 4 Replies
View Related
Jun 22, 2010
I'm running Redhat 5 Enterprise (Nautilus 2.16.2) with Gnome and am having trouble changing the default application for PDFs. No matter what I do, it seems to always come up as evince.
First I tried browsing to a PDF file using Nautilus, right clicking on a PDF file, selecting properties, open with, and then changing the radio button. However, the radio button is selecting "Document Viewer" and clicking on the other buttons doesn't do anything. The button is stuck on "Document Viewer" (I'd like to use Adobe Acrobat).
I thought I'd do it manually then. Running `gnomevfs-info file.pdf" shows code...
So now xdg-mime and gnomevfs-info are showing different default applications for this file type. I've tried updating the mime database using update-mime-database ~/.local/share/mime as well as updating my desktop database using update-desktop-database ~/.local/share but nothing seems to be working.
Changing a default application really shouldn't be this difficult. What should I try next to change my default application?
, however, shows something different
My .local/share/applications/defaults.list file, however, shows the following:
application/pdf=AdobeReader.desktop
View 1 Replies
View Related
Sep 12, 2010
I currently have 3 files with floating point data that I wish to have in a single file with the format:
Code:
F1 F1 F3 Output
a1 b1 c1 a1 b1 c1
a2 b2 c2 a2 b2 c2
a3 b3 c3 a3 b3 c3
a4 b4 c4 a4 b4 c4
View 3 Replies
View Related
May 2, 2010
i am on processing text tasks And i found that if you assign a text to a variable is chomp'ed automatically the newline
Code:
variable=$(cat file.txt)
The problem is i can only access the items/lines using:
Code:
for line in $variable
do
echo $line
# Other commands
done
how do i convert this to an indexed array. More importantly, how do i get access to individual $line[0], ..., $line[n] Another thing, if the file.txt, has lines with spaces it is a mess using the for...in..., but echoing prints line by line...o_0
View 11 Replies
View Related
Sep 28, 2009
my linux box in the office has an a proxy server to access the internet. i can set this on my browsers. id like to know how i give my shell (bash) the proxy server settings so i can wget,yum install perl modules, etc. on my shell terminal without problems.
i used
Code:
export http_proxy=http://<proxy-server-ip>:<port>
for example
Code:
export http_proxy=http://bsc.aut.ac.ir:8080
and also i did this for ftp. but i doesn't work.
View 6 Replies
View Related
Jan 25, 2011
Code:export EDITOR="nano" in ".zshrc". How do I use default text editor now?
View 1 Replies
View Related
Sep 28, 2010
Is there a native Linux application that facilitates/enforces semantically marked-up text in a common format (HTML, Markdown, etc.) with instant feedback of how it looks with "pretty" formatting?
I'm looking for something like (the rather brilliant) browser-based WMD, but with the following additional features code...
View 1 Replies
View Related
Jan 13, 2011
i use uxrvt ( for those who dont know, its terminal emulator based on xterm).i know its easy to copy/paste stuff from terminal to itself is a trivial thing. it can be done by mouse left click to select and middle click to paste.but in my case i need to copy text from terminal to another application, viz on google chromium.
View 1 Replies
View Related
Oct 21, 2009
Is it possible to set a default setting for the terminal? When I open one up it is very small and I press the ctrl++ several times to get it so that I can read it?
View 2 Replies
View Related
Jun 21, 2010
I would like to append text to a file. so i wrote in bashecho text >> file.confHowever it doesnt leave a new line. So i can only do this once. How do i add a new line?
View 2 Replies
View Related
Nov 28, 2010
I need to search for a string "teststring" in all *.java files coming under /home/user1/ (including subfolders). How can I do it in linux via shell command.
View 5 Replies
View Related
Nov 30, 2010
I am looking at how to add particular text to a file in bash.Here is what I am trying to do:In the /etc/grub.conf file, I am trying to add "audit=1" (without the quotes) to the end of the kernel line...such as:kernel /vmlinuz-2.6.18-194.el5 ro root=LABEL=/1 rhgb quiet audit=1
As there are a few different lines in this file, I am only looking to add the "audit=1" to the above line via a bash script.
View 7 Replies
View Related
Feb 28, 2011
I have a lot a folders, each named by a number, and in each of these folders I have a specific file (stddev.dat) containing a single line (of numbers) I need to have a single file with each line being one of the stddev.dat (no matter if it is sorted or not), and also I need to add at the begining of each line the number of the folder it comes from.
I 'm no bash expert, and the "add at the begining of the line" is a bit of problem to me". Here is what I've come up with so far, just to put everything in one file, (and also if you know a better/more elegant way to do the same thing I've done, I'm listening)
[Code]...
View 6 Replies
View Related
Jul 28, 2010
How can I change the default text editor for console programs in Ubuntu.When I run mutt and send a message, it currently loads up Joe and I would prefet to load Vim.I know I can change $EDITOR for me only, but would prefe to do it system wide.
View 2 Replies
View Related
Apr 2, 2011
I'm using emacs 23.2.1 with quack on Linux and trying to set my default typeface to Inconsolata Medium 13. It is installed on my system (debian sid) and can be set manually per buffer in emacs. However, I would like it to be used throughout and by default. My suspicion is that quack's mode is somehow conflicting.
I've searched a good deal looking for information on font customization in emacs. Although there is documentation and examples out there, I've found them fairly incoherent when taken together and nothing specifically addressing this issue. Here is my .emacs
set-default-font "Inconsolata-13")
Turn on visible-bell, get rid of beeps
setq visible-bell t)
Hilight the selected region
setq transient-mark-mode t)
[Code]...
View 2 Replies
View Related
Oct 12, 2010
I cant understand how to sort out from this problem, while check the cobbler boot server, from the command cobbler check follwing error comes out , i dont understand how to fix it
1 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one Restart cobblerd and then run 'cobbler sync' to apply changes.
View 1 Replies
View Related
Jan 19, 2010
This code:
Code:
#! /bin/bash
echo Okay.
echo
Does not do it....
P.S. I want to show my parents what happens when I do:
Code:
sudo make me a sandwich
and have it say "Okay."
View 11 Replies
View Related
May 29, 2010
I have already had Vista installed on another drive and from what i've read on the webs you get to dualboot if you install ubuntu after vista. when i did install it (i installed on a blank hdd with no partitions, choosing the "erase entire disk" option since for some reason default option was attempting to eat a part of my windows 1 gb drive instead of using disk i specially made for it) and the grub 2 loaded for the first time, there was NO option to run vista. only 2 linux (normal and recovery) and 2 memtests. I've ran linux and went to google this. I found that i should add something to some config files in /etc/grub.d/From reading the readme file i understood i could add my own files that are named like NUMBER_SOMENAME and insert code into them. Because it said:Quote: For example, you can add an entry to boot another OS as01_otheros, 11_otheros, etc, depending on the position you want it to occupy inthe menu; and then adjust the default setting via /etc/default/grub. But then i found a file 40_custom that said:
Code:
#!/bin/sh
exec tail -n +3 $0
[code]....
View 9 Replies
View Related