Useful linux commands


Full article

I'll leave below also a cheat sheet :)

Create a soft or symbolic link?
sudo ln -s /path/to/source/file

Note: this works if you both nodes are below you in the same tree. You can use relative notation

-s command makes it a symbolic link
-n makes it possible de create a folder-type symlink

Note that wherever you currently are is where the shortcut will be created.

Find a document on the server:
sudo find / -name foo.txt (foo.txt is the file to search)

Get full path of a file/folder
readlink -f file.txt

Switch to root:
sudo -i

Switch user between terminals:
su - user2

Remove directory:
sudo rm -rf folderName