Here are some useful stuff I need to blog about just in case I need to find them again. Also, some side notes to help me get to know linux better
Copying problem
when you are copying a folder to another place and you want to rename that folder then DONT create that folder first!!
eg.
If I have /home/micmek/testA and I want to copy it to /home/micmek/workingA
If folder workingA already exists then
will produce
but if the folder doesnt exist then the SAME command will produce
Links
Symbolic Links vs. Hard Links
Symbolic links point to the file/folder path
Hard links find the Inode that the file is pointing to and points to the same Inode (Data/Content)
Folders have to be symbolic link
Useful commands
Exiting SSH
Type ~. and you will exit ssh
Boot Log
To find out the log messages from your the booting up of linux ie. all the hardware info type
This is useful for mounting purposes too.
Paths
To find out where a file that you commonly execute is in the path structure type the following
Find string in path
To find a certain pattern in a set of files then type
This returns all the files that contain that string
Size of folder
To find the size of a folder type (uses the Disk Usage command)
File Permissions
Confusing as it is it’s pretty simple
Where OGO is a 3 digit number.
O-Owner G-Group O-Other Users
4 = READ || 2 = WRITE || 1 = EXECUTE
So if you want a file to be
|
Owner |
Group |
Others |
| Read (4) |
4 |
4 |
4 |
| Write (2) |
2 |
0 |
0 |
| Execute (1) |
1 |
1 |
1 |
| Total |
7 |
5 |
5 |
Changes owner of file
Mounting
List of mounted devices
To find out what has been mounted type df
Mounting & Unmounting
To mount type
To unmount type
Mounting & Unmounting SSH path
To mount a sshfs type
To unmount type
More Info here:
how to mount a remote ssh file system using sshfs
Services
Services are started and stopped through the following command:
Linux Folder structure
Logs are kept under
Software is usually installed under
Package
To install a package use
To install a package use
To find out where a package is installed type