About LINUX files and processes

File and process management > About hard links and symbolic links

Most operating systems have several mechanisms that allow you to give different names to files and directories to access the same file. In LINUX, there are two types: hard links and symbolic links. In the flow of the story, I will touch on inode first. All files are assigned a unique number called the inode number, which records the file type, size, access rights, etc. Is it equivalent to a foreign key in SQL? From here, the main subject is that a hard link can refer to that data from each file name if there is even one data stored on the disk, but there are multiple files that refer to it. The inode number assigned to the file and the created file does not change. In other words, if you change either, both will change. The symbolic link is then the pointer itself to the link source. Therefore, only the link source can be deleted, and in this case, the link source cannot be referenced from the symbolic link.

Create a link

Syntax: *** ln [optional] {link source} {link file name} *** You can create a symbolic link with the option -s, or a hard link without it.

  • If you want to copy the symbolic link itself, use *** cp -d ***.

Process monitoring

A process is the basic unit by which the OS manages a program.

Syntax: *** ps [optional] ***

I often use ***-ef *** as an option.

top - 18:04:13 up 17 days, 1:47, 2 users, load average: 0.00, 0.00, 0.00 Tasks: 128 total, 1 running, 127 sleeping, 0 stopped, 0 zombie Cpu(s): 0.0%us, 0.3%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 1020488k total, 816472k used, 204016k free, 186292k buffers Swap: 2064376k total, 0k used, 2064376k free, 369096k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1874 root 20 0 433m 39m 9536 S 0.3 3.9 24:51.55 java 1 root 20 0 19360 1544 1224 S 0.0 0.2 0:01.25 init 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd 3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0

Recommended Posts

About LINUX files and processes
Linux: files and directories
About Linux
About Linux
About Linux
About Linux
About Linux ①
About _ and __
[Linux] About export
[Linux] About PATH
Linux (about groups)
About Class and Instance
Daemonizing processes on Linux
OS and Linux distribution
Linux (about directory path)
About Linux kernel parameters
Investigated processes and jobs
About cumprod and cummax
Basic knowledge about Linux
About cross-validation and F-number
Maintain directory structure on Linux and move old files
Get files from Linux using paramiko and scp [Python]
Studying Linux commands and frustration
This and that about pd.DataFrame
About Linux environment construction (CentOS)
CLI and Linux basic terms
Linux (About adding / removing users)
Device and Linux file system
About python objects and classes
About Python variables and objects
[Linux] Compress folders and transfer files from remote to local
About Raid group and LUN
Reading and writing csv files
About fork () function and execve () function
Recording and playback on Linux
About Django's deconstruct and deconstructible
About Python, len () and randint ()
About Python datetime and timezone
About Sharpe Ratio and Sortino Ratio
Linux file and directory permissions
What I learned about Linux
About Python and regular expressions
About handling Django static files
About Python and os operations
Commands and files to check the version of CentOS Linux
About http.Handle () and http.NewServeMux (). Handle ()
Python # About reference and copy
About Numpy array and asarray
About Python sort () and reverse ()
Differences between Windows and Linux directories
Basic knowledge of Linux and basic commands
About installing Pwntools and Python2 series
Are macOS and Linux completely different?
(Windows10) Install Linux environment and gnuplot.
Summary and common errors about cron
[linux] Swap Caps Lock and Ctrl
Manipulate files and folders in Python
About Linux environment construction (VMware VirtualBOX)
About python dict and sorted functions
About dtypes in Python and Cython
About MkDocs themes and their customs