User Tools

Site Tools


howto:bashprofile

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howto:bashprofile [2023/02/16 21:36] – [defining aliasess] kamaradskihowto:bashprofile [2023/02/16 23:25] (current) – [defining aliasess] kamaradski
Line 20: Line 20:
 export password=somethingSecret123 export password=somethingSecret123
 export APIkey = 12345-abcde-12345-ABCDE-00100 export APIkey = 12345-abcde-12345-ABCDE-00100
 +
 +# NOTE: the above is an example, your bash_profile is NOT a safe place to keep passwords.
 </code> </code>
  
Line 53: Line 55:
 alias fgrep='fgrep --color=auto' alias fgrep='fgrep --color=auto'
 alias egrep='egrep --color=auto' alias egrep='egrep --color=auto'
 +alias somewebsite='open https://somewebsite.com/path/to/file.html'
  
 ### print current time in UTC ### print current time in UTC
Line 91: Line 94:
  
 You can find more information about the syntax and available codes for the Bash Prompt Escape Sequences in the Bash manual, which is available on most Unix-based systems by typing ''man bash'' in the terminal. You can find more information about the syntax and available codes for the Bash Prompt Escape Sequences in the Bash manual, which is available on most Unix-based systems by typing ''man bash'' in the terminal.
 +
 +
 +==== Functions configuration ====
 +
 +If you spend a lot of time on the CLI you can use it to create handy functions like for example go a google web search from the command line as such:
 +
 +<code bash>
 +### terminal shortcuts
 +function gg() { open https://sometool.com/?qs-q="$1"; }
 +function google() { open https://www.google.com/search?q="$1"&btnK=Google+Search; }
 +</code>
 +
 +Calling the following command would then open a browser tab with the corresponding google-search: ''%%google "mysearch"%%''
 +
 +==== tuxsay ====
 +
 +This should be installed on any computer where the terminal is used regularly, for obvious reasons (cowsay with tux layout):
 +
 +<code bash>
 +### tuxsay/cowsay & fortune setup
 +#i="$(fortune -s computers)" && cowsay -f tux $i && say $i
 +fortune -s computers | cowsay -f tux
 +</code>
 +
 +{{:howto:tuxsay.png|}}
  
  
howto/bashprofile.1676583405.txt.gz · Last modified: 2023/02/16 21:36 by kamaradski