-
Notifications
You must be signed in to change notification settings - Fork 0
Useful Ubuntu Commands
Shamik Biswas edited this page Apr 26, 2023
·
6 revisions
sudo update-alternatives --config editorChecking and adding environment variables.
printenvprintenv HOMEecho $HOMEprintenv PATHecho $PATHprintenv HOME PATH# replace my username with yours in the command below
export PATH="/home/shamik/.local/bin:$PATH"In order to configure a new environment variable to be persistent, we’ll need to edit the Bash configuration files. This can be done through three different files, depending on exactly how you plan to access the environment variable.
-
~/.bashrc– Variables stored here will reside in the user’s home directory and are only accessible by that user. The variables get loaded any time a new shell is opened. -
/etc/profile– Variables stored here will be accessible by all users and are loaded whenever a new shell is opened. -
/etc/environment– Variables stored here are accessible system-wide.
# replace my username with yours in the command below
export PATH="/home/shamik/.local/bin:$PATH"# replace my username with yours in the command below
export PATH="/home/shamik/.local/bin:$PATH"# replace my username with yours in the command below
PATH="/home/shamik/.local/bin:$PATH"rm -r <path of the folder>This happens because of the number of files being too many so the following will work:
find <path of the folder> -type f -exec rm {} +sudo lsblkGenerally sda will be the boot disk and if you have only one disk, which can be attached then it will be sdb. However, if you have multiple disks, which can be attached it will be autoincremented to sdc,sdd,... In case you detach and then re-attach the disk then the disk name will be autoincremented too e.g., for sdb it will become sdc as there's only one disk.
sudo mkdir /mnt/disks/<name of your choice>
sudo mount -o discard,defaults /dev/sdb /mnt/disks/<name of your choice>