I would like to use python3 as my default python when working with the terminal. If I added the line alias python=python3 in my ~/.bashrc, could that cause problems with other programs?
1251
The python program command executes Python 2. Python 3 can be executed using the python3 command.  How can Python 3 be executed using the python command?
96885
I want to add this iostat command to my .bashrc and create an alias for it: iostat -xk 2 $(findmnt -T ~ | awk 'END {print $2}')  I'm adding this to my .bashrc: alias ios='iostat -xk 2 $(findmnt -T ~ | awk 'END {print $2}')'  Unfortunately, it doesn't work. If I run the above iostat command in a terminal it works, but when I run the ios alias it no longer works. And yes, I restart my shell every time.
86731
In bash, suppose I have these commands:  $ pyt[TAB][TAB] pytest python python-config python-dbg   99% of the time, I'd go for python. It's so annoying that pytest pops up and prevents me from typing only pyt[TAB][RETURN] to invoke python. Can I hide pytest from bash completion?  My limitations:   I know that I can remove the pytest binary at /usr/bin/pytest to prevent that suggestion within bash. But what if I have no root access? What if pytest is an important script that must exist in order to let other scripts work properly? Even though I can remove the pytest binary (and I've done it before), some time when I upgrade my software, this script comes back again. I know that I can use an alias to save keystrokes for my favorite applications (maybe just p for python). But I don't like these non-standard abbreviations. It kind of makes me confused when I remote to other machines.   So, is there any way to hide some commands from bash completion? Answers in other shells (zsh, fish, etc) are welcome since bash doesn't speed up my workflow lately.
93425
I would like to make my terminal's command prompt shorter. Currently I am using Python 's virtualenv and virtualenvwrapper so that is causing lots of extra text to be displayed in my command prompt. I need to shorten that up to the bare minimum so I'd like to take this:  (pytutorial)sez@sez-laptop:~/.virtualenvs/nettuts/firstblog$   and ideally turn it into   (pyt)sez:~/.virtualenvs/nettuts/firstblog$   or maybe something shorter perhaps. Right now I am using Gnome Terminal 2 &amp; bash.   Any suggestions?
22657
I need help running python in ubuntu  I can run python without a problem in my terminal but when I create a .py file I can't get it to run.
64012
I have a Python script which I would like to execute at every startup. I can run it by adding this to the startup applications:  python3 /path/to/script.py   That works, but it doesn't open a terminal window, so I can't see the program's output. How could I make it open a terminal window and execute the script in there?  Note: I get the window to stay open with input(' ') at the end of the Python script. Thanks!
110910
Here's my current bash which is just a loop while true ; do       python3 /Users/Name/Desktop/pythoncode.py done  I want to terminate pythoncode.py if it doesn’t output anything to the terminal in 2 min
35087
In scripts, first line should specify the path to interpreter. But on different servers Linux, Unix, or BSD this path could be different.  What is more preferable?  #!/usr/bin/env bash    or  #!/bin/bash
42676
I was wondering if there is something like an interpreter for C.  That is, in a Linux terminal I can type in "python" and then code in that interpreter.  (I'm not sure interpreter the right word).  This is really helpful for testing different things out and I'm curious if something similar exists for C.  Though I doubt it.  The only thing I can think of that would do it would be the C shell...
37894
There's already  which point to various executables (with or without full path). , not necessarily the name of the executable (in xterm it's xterm-color, and in gnome-terminal it's xterm-256color). Is there a variable which is expected to contain the name or path of the executable to use as the default terminal in Linux? (Or Arch Linux, if there is a custom convention.) Maybe this is nonsensical, since GUI programs are rarely spawned from shells which know of these variables…
115917
How does one get ~/.bashrc aliases to evaluate $() substitutions at run time, instead of at the time that ~/.bashrc is executed (when opening a terminal)?  I run this command often enough that I would like to add an alias for it:  svn diff -r $(svn info | grep ^Revision | awk {'print $2'}):HEAD $(svn info | grep ^URL | awk {'print $2'}) | colordiff   However, when I add it to ~/.bashrc as an alias, I see that the evaluations are hard-coded to the values they had at the time I opened the terminal:  $ alias alias svnbranch='svn diff -r 178184:HEAD svn+ssh://branches/t4252 | colordiff'   If I open a terminal in ~ then I get errors:  svn: E155007: '/home/dotancohen' is not a working copy svn: E155007: '/home/dotancohen' is not a working copy svn: E155007: '/home/dotancohen' is not a working copy svn: E155007: '/home/dotancohen' is not a working copy $ alias alias svnbranch='svn diff -r :HEAD  | colordiff' $   I've tried these two variations of the alias in ~/.bashrc, they both have the same effect (as I expected):  alias svnbranch="svn diff -r $(svn info | grep ^Revision | awk {'print $2'}):HEAD $(svn info | grep ^URL | awk {'print $2'}) | colordiff" alias svnbranch="svn diff -r `svn info | grep ^Revision | awk {'print $2'}`:HEAD `svn info | grep ^URL | awk {'print $2'}` | colordiff"   How does one get ~/.bashrc aliases to evaluate $() substitutions at run time?  Additionally, how would one search for this situation in Google? I've tried to google on "bashrc substitution", "bashrc lazy substitution", and other key phrases, but I've found nothing for what I feel should be a common enough issue to find information on.
12192
By typing a manually specified command in terminal I want to execute some other command.  How could add an alias to a command? Can i do that with the help of the terminal or should I edit some kind of file?
19653
I have installed python-pygments and using it for syntax highlighting with less as described by mankoff  I put a function in my .bashrc  cless () {     pygmentize -f terminal "$1" | less -R }   it is enabling syntax highlighting with less. But when I am going to open a file like /etc/fstab or /etc/apt/apt.conf a error saying  Error: no lexer for filename '/etc/apt/apt.conf' found   I found option to show pygmentize the lexer with -l at this . But what will be the appropriate lexer for such files? and how to use it?
53519
I have 14.04. I read on the pip readthedocs that pip is included by default with Python 3. When I installed Python 3 on Windows it was there, but I'm getting pip command not found on Ubuntu. I checked dpkg and it is not there. I also looked at the Ubuntu Python 3 port page and did not see anything. If pip is here, where do I find it and get it working? If it is not here, why and what else is missing from the default Python 3 that I should know about so I don't waste time looking for it?
116261
I'm using Cygwin, and have installed all the developer packages as well as most if not all of the other packages. When I provide an alias for gcc, I get the error  -bash: alias: gcc: not found   What could I be doing wrong?  I am typing the following command into the terminal:  alias gcc "gcc -ansi -Wall -g -O0 -Wwrite-strings -Wshadow -pedantic-errors -fstack-protector-all"   FYI, this alias works on other systems.
35715
I have installed ubuntu 18.04 in virtual box and when trying python -v, it says you have python3 installed, I want to remove python 3 or disable so that can use python2.7 and run some scripts i have.
13765
Let's say I have the following alias in bash - alias ls='ls --color=auto' - and I want to call ordinary ls without options. Is the only way to do that is to unalias, do the command and then alias again? Or there is some nifty trick or workaround?