Post

Linux-Commands-pt2

Linux-Commands-pt2

Linux Commands

These are some useful Linux commands that I find myself using over and over. This list consists of some fun things I find useful for me, while working.

In order to not have an endless page of content, see the related pages

Linux-Commands-pt1

Custom Bash prompt

I got this from one of my favorite content creators, Jay over at Learn Linux.tv. I made a slight change to the prompt

Create a new file in your home dir, something like ~/.bash_prompt and enter the below text

1
2
3
4
5
6
7
8
9
10
11
12
13
BRACKET_COLOR="\[\033[38;5;35m\]"
CLOCK_COLOR="\[\033[38;5;35m\]"
JOB_COLOR="\[\033[38;5;33m\]"
USER_COLOR="\[\033[38;5;33m\]"
PATH_COLOR="\[\033[38;5;33m\]"
LINE_BOTTOM="\342\224\200"
LINE_BOTTOM_CORNER="\342\224\224"
LINE_COLOR="\[\033[38;5;248m\]"
LINE_STRAIGHT="\342\224\200"
LINE_UPPER_CORNER="\342\224\214"
END_CHARACTER="|"

tty -s && export PS1="$LINE_COLOR$LINE_UPPER_CORNER$LINE_STRAIGHT$LINE_STRAIGHT$BRACKET_COLOR[$CLOCK_COLO>

Save the file. Then open up your bashrc file ~/.bashrc and put the following at the end of it

1
source ~/.bash_prompt

Than, just reload your shell

1
. ~/.bashrc

Alternatively, I’ve also used the ZSH shell and installed oh-my-zsh to make it more productive.

Get the forecast

Did you know you can get the forecast from your CLI?

1
curl wttr.in

Will output something like

1
2
3
4
5
6
7
8
9
-> % curl wttr.in
Weather report: Manhattan, New York, United States

       .-.      Rain
      (   ).    +73(77) °F
     (___(__)   ↖ 8 mph
    ‚‘‚‘‚‘‚‘    3 mi
    ‚’‚’‚’‚’    0.4 in

Plus the forecast for the next 3 days.

-eof-

This post is licensed under CC BY 4.0 by the author.