Last active
October 7, 2022 13:05
-
-
Save thomas-schuster/37e97557768f309ea08fa3c9a6659e95 to your computer and use it in GitHub Desktop.
Working on bash...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# steps in bash | |
# access home folder | |
cd ~ | |
# create a folder called cloud | |
mkdir cloud | |
# access the new folder | |
cd cloud | |
# create a file | |
touch myfirstfile | |
# now create a link in home folder | |
cd .. | |
# creates a symbolik link | |
ln -s ./cloud/myfirstfile ./myfirstlink | |
# edit our file using the link | |
nano ./myfirstlink | |
# do some edits and then check them in your original file | |
cat ./cloud/myfirstfile | |
# create another but hard link | |
ln ./cloud/myfirstfile ./myfirsthardlink | |
# delete our symbolic link | |
rm ./myfirstlink | |
# make sure our file is still there | |
ls ./cloud | |
# recreate our symboliklink | |
ln -s ./cloud/myfirstfile ./mysecondlink | |
# now let's delete the file | |
rm ./cloud/myfirstfile | |
# watch that our hardlink and of course all file contents are still there | |
cat ./myfirsthardlink | |
# what happened to our symbolic link? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment