Tag Info

New answers tagged


Got it I ended up making a function as suggested idea(){ cd ~/idea-IU-143.381.42/bin; ./idea.sh }


You need to escape the $ to prevent it being expanded by the shell; since it expands to nothing, your alias becomes equivalent to alias print="echo a b | awk '{print }'" Try instead alias print="echo a b | awk '{print \$2}'"


There's couple of options if you make mistakes : keep multiple copies of your personal .bashrc before making changes, so you don't have to undo edits. If something goes wrong, you can always open .bashrc with a graphical text editor , like gedit, and undo changes If you absolutely have to nuke the old bashrc, do cp /etc/bash.bashrc $HOME/.bashrc If you ...


Perform a backup cp ~/.bashrc ~/.bashrc.bak Make your changes Re-check the changed .bashrc and activate with source ~/.bashrc or simply start a new shell with bash Test the changes If you experience problems restore the .bashrc cp ~/.bashrc.bak ~/.bashrc A source ~/.bashrc isn't helpful now. You have to logout and re-login


To do this temporarily but immediately/on-the-fly, for example so that you can have some privacy while making a screencast, you can do the following echo PS1='$\ ' > /tmp/ps1 && source /tmp/ps1 && rm /tmp/ps1 The PS1 variable sets the format, source applies that setting by reading from a file. Now the command line looks like this: $ ...


You can use shell builtin command to escape aliases (and functions): command alias_name For example: command ls will run /bin/ls binary , not any alias defined as ls. An alternative is to use quotes: "alias_name" or 'alias_name' For example: "ls" or 'ls' these again will run the /bin/ls binary, ignoring any alias ls.


Alternatively, you could specify full path to command. For instance, my ls command is aliased to ls='ls --color -F' What one can do is either call /bin/ls or $(which ls) (for those of us who are lazy to type full path). Example : calling original command with flags $(which ls) -l


Run the command with a leading \, an answer in examples: ;) % ls bar foo % alias ls="ls -laog" % ls total 4292 drwxrwxr-x 4 4329472 Nov 5 15:06 . drwx------ 95 28672 Nov 5 15:15 .. -rw-rw-r-- 1 0 Nov 5 15:06 bar drwxrwxr-x 2 4096 Nov 5 15:06 foo drwxrwxr-x 2 4096 Okt 2 14:29 .foo -rw-rw-r-- 1 191 Feb 25 2015 .htaccess % \ls ...


I realize this is super old but since nobody suggested creating an alias I figured I'd post. Using Bash Prompt Escape Sequences I made an alias shorten In ~/.bash_aliases here you will notice the $Blue var to set the prompt colour which you can omit or change based on preference I also clear the terminal when calling shorten. alias c='clear' alias ...

Top 50 recent answers are included