-
Notifications
You must be signed in to change notification settings - Fork 3
Tipsandtricks
- Editing a file in Ubuntu using nano text editor
- Editing your startup bash script in Ubuntu
- Access Cloud Drive folder
Assume you want to add some lines of text to a file called foo.txt
in your home directory using nano.
- Open a Ubuntu shell
nano ~/foo.txt
- Copy and paste the following lines into the file
This is file foo
It doesn't do much
- Save and exit with
Ctrl-O
andEnter
- Look at your results
echo ~/foo.txt
- Now delete the file with
rm ~/.foo.txt
On occasion, you'll need to modify your Ubuntu bash shell environment to load something on startup. Building on the last tip, you can edit your .bashrc
file
- Open a Ubuntu shell
nano ~/.bashrc
- Add or paste in your configuration. This can be done at the top or bottom of the file usually.
- Save and exit with
Ctrl-O
andEnter
- Reload your bashrc with
source ~/.bashrc
or you can just close and restart your Ubuntu shell.
/Users/MAC-OS-USER/Library/CloudStorage/Box-Box
This is useful if you manage your spatial data in Box and collaborators sync it to their local computers. This lets you bring your Box Drive folder into your Ubuntu docker container so that you can symlink it to your data/src
folder and import data in a consistent way across all users.
Note, this could be used with other drive share systems such as Google Drive.
First, ensure you have Box Drive installed, and you have enabled sync of your data to your local computer.
Open a terminal and assuming your username is alex
check that the following path exists
ls /Users/alex/Library/CloudStorage/Box-Box
If you see the top-level of your synced files, then you are good to go.
Source - https://github.com/microsoft/WSL/issues/4310
C:\Users\alex\box
Now add the following to your bashrc:
if ! findmnt -M /mnt/box &>/dev/null; then
sudo mount -t drvfs 'C:\Users\alex\box' /mnt/box
fi
On every Ubuntu shell startup you will nowbe prompted for your root password. Once entered the drive mount will be performed.
Now verify your box files are accessible from Linux
ls /mnt/box