To open a file using kate
, you can run something like:
kate filename
This might show some messages like:
kate(3702)/kdecore (services) KMimeTypeFactory::parseMagic: Now parsing "/usr/share/mime/magic"
kate(3702)/kdecore (services) KMimeTypeFactory::parseMagic: Now parsing "/home/user/.local/share/mime/magic"
Bus::open: Can not get ibus-daemon's address.
IBusInputContext::createInputContext: no connection to ibus-daemon
To remove these messages, redirect the error output stream to /dev/null
:
kate filename 2>/dev/null
If you want to continue using the same terminal, add an &
after the command:
kate filename 2>/dev/null &
If you want to run edit filename
to open it, you could create a bash function in your ~/.bashrc
file. Add the next code to your ~/.bashrc
file:
edit() { kate "$@" 2>/dev/null & }
Imgur provides tools for this. You can even download a shell script from imgur.com which works from the command line.
Of course, installing software directly instead of using Ubuntu's official repository opens a security hole which makes GNU/Linux vulnerable to trojan malware. While usually not recommended, you can still do it, if you want to. Here's how.
First, if you do not have a personal bin
directory to store executables, create one by running the following commands:
cd
mkdir bin
source .profile
To download and install the imgur script, run the following commands (you do not need to be root):
wget http://imgur.com/tools/imgurbash.sh
chmod a+x imgurbash.sh
mv imgurbash.sh ~/bin/imgur
Now, simply run imgur
with the path to an image to upload it to Imgur.
For example:
imgur /usr/share/banshee/icons/hicolor/128x128/devices/phone-google-nexus-one.png
This gives the following output:
http://i.imgur.com/SoIwv.png
Delete page: http://imgur.com/delete/VTtZOI9LOhtZ2oB
Haven't copied to the clipboard: no $DISPLAY
The first line is the link to the Imgur page, and the second line is the link to delete the image you just uploaded. If possible, the script will also copy the Imgur url to the clipboard for immediate use.
Enjoy!
[Note: this answer previously suggested running the commands as root in order to put the imgur script into /bin
. Using root should be avoided whenever possible. In this case, we can create a user's personal ~/bin
directory. It's an extra step, but the security is worth it.]
Best Answer
The list of (mostly third-party) tools on the imgur website (http://imgur.com/tools) features three
bash
scripts:img Bash Script Uploader by Ceryn
Imgur-Screenshot by jomo