Tech-Roy Blog

技術分享 技術無界 開源至上

Create a .bashrc file

1
touch /home/roy/.bashrc


P.S.: “roy” is your username; please replace it with your own username.

Enter edit mode

1
2
cd /home/roy/
sudo nano /home/roy/.bashrc

~./.bashrc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Add the user's local bin directory to PATH
# Global Environment Variable
export PATH="$HOME/.local/bin:$PATH"

# Hexo
alias hexocgd="hexo clean && hexo generate && hexo deploy"
alias hexo4000="hexo clean && hexo generate && hexo server"

# Quickly Command
alias rmd="rm -rf"
#alias e="vim ~/.bashrc"
alias e="nano ~/.bashrc"
alias s="source ~/.bashrc"
alias c="clear"
alias la="ls -la"
alias ll="ls -lah --color=auto"
alias grep="grep --color=auto"
alias catbashrc="cat ~/.bashrc"
alias ipcheck="ip route get 8.8.8.8"
alias testgoogle="curl -Iv https://www.google.com --connect-timeout 10"
alias testyoutube="curl -Iv https://www.youtube.com --connect-timeout 10"
alias restartdhcpcd="sudo systemctl restart dhcpcd"
alias dockerrestart="sudo systemctl daemon-reload && sudo systemctl restart docker && sudo systemctl status docker"
alias wificheck="sudo nmcli dev wifi list"
alias editdhcpcdconfig="sudo nano /etc/dhcpcd.conf"
alias rpishutdown="sudo shutdown -h now"
alias rpireboot="sudo reboot"

# Docker command
alias dps='docker ps -a --format "table {{.Names}}\t{{.ID}}\t{{.Status}}\t{{.Image}}"'

# Quickly come to file address
alias ..="cd .."
alias ...="cd ../.."
alias ~="cd /home/roy"

# Functions
# Create a directory and immediately enter it
mkcd() {
mkdir -p "$1" && cd "$1"
}

Make it effective

1
source /home/roy/.bashrc

Check if the file has been created.

1
ls -la /home/roy/.bashrc

Have all file permissions

1
sudo chmod -R 777 /home/roy/.bashrc

Introduction

Hi guys, this is the first article in my DIY Raspberry Pi NAS series. In this post, we will install Raspberry Pi OS on a Raspberry Pi single-board computer. After that, we will use it as the foundation to install various third-party applications and build the basic services of a NAS.

Required Equipment

  • Raspberry Pi 4B
  • 64GB microSD card
  • microSD card reader
  • Raspberry Pi power supply
  • Ethernet cable
  • HDMI cable
  • Mini HDMI adapter
  • Monitor

Procedure

  1. First, format the microSD card and prepare it for installing Raspberry Pi OS.
  2. Insert the microSD card into the card reader.
  3. Download Raspberry Pi Imager, the official image flashing tool for Raspberry Pi.
  4. Download the latest version (for example, imager_1.8.5) from the official Raspberry Pi website to ensure security, rather than downloading it from third-party platforms.
    4.1 Click here –> Raspberry Pi official website download link
    4.2 Go to the homepage and click “Software” in the top navigation bar.

    4.3 Scroll down and find “Download for XXX”.

    4.4 Download the file to any location on your local disk.

    4.5 After the download is complete, double-click the installer to start the installation. Click “Next” until the installation is finished, or choose any drive you prefer for installation.
  5. Open Raspberry Pi Imager and start flashing Raspberry Pi OS.

    5.1 Click “Choose Device” and select your Raspberry Pi model according to your needs.

    5.2 Click “Choose OS”.
    Notes:
    If you want to reduce power consumption, select Raspberry Pi OS (Legacy, 64-bit) Lite, which does not include a desktop environment and only provides a command-line interface.
    If power consumption is not a concern, select Raspberry Pi OS (Legacy, 64-bit) Full, which includes a graphical desktop environment.


    5.3 Click “Choose Storage” and select your storage device.

    5.4 Click “Next”. A pop-up window will appear. Click “Edit Settings”.




    5.5 Finally, click “Save” and then “Next”. A warning dialog will appear. Click “Confirm”. This will erase all existing data on the card, so make sure to back up your data if necessary.

  6. After the flashing process is complete, close the Raspberry Pi Imager.
  7. A system prompt may appear on your desktop asking to format the drive. Do not worry—just click “Cancel”.
  8. Remove the microSD card and insert it into the Raspberry Pi.
  9. Connect the Mini HDMI adapter, and use an HDMI cable to connect the Raspberry Pi to the monitor.
  10. Power on the Raspberry Pi and wait a few minutes for the system to initialize.
  11. When the command-line interface appears, enter the login username and password.
  12. Congratulations! Raspberry Pi OS has now been successfully installed.

Conclusion

After completing the steps above, we can move on to DIY this Ubuntu system on the Raspberry Pi.
Please stay tuned to this technical blog for the upcoming articles. Thank you!

Founded

June 7, 2025

Purpose

To document my hands-on experiences, I record my practical work and processes in English to improve my writing skills while sharing technical insights along the way.

Slogan

Technology Sharing·Technology Without Boundaries·Open Source Above All

Website

https://tech-roy.uk/

Website Avatar

0%