vmtouch seems like a good tool for the job.
Highlights:
- query how much of a directory is cached
- query how much of a file is cached (also which pages, graphical representation)
- load file into cache
- remove file from cache
- lock files in cache
- run as daemon
vmtouch manual
EDIT:
Usage as asked in the question is listed in example 5 on vmtouch Hompage
Example 5
Daemonise and lock all files in a directory into physical memory:
vmtouch -dl /var/www/htdocs/critical/
EDIT2:
As noted in the comments, there is now a git repository available.
Related Posts:
- Meaning of the buffers/cache line in the output of free
- Why drop caches in Linux?
- swap partition vs file for performance?
- In Linux, what is the difference between “buffers” and “cache” reported by the free command?
- Confused about stdin, stdout and stderr?
- How to set the environmental variable LD_LIBRARY_PATH in linux
- What’s a .sh file?
- How to fix ‘sudo: no tty present and no askpass program specified’ error?
- What does pss mean in /proc/pid/smaps
- apt-get error: Sub-process /usr/bin/dpkg returned an error code (1)
- error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)’ — Missing /var/run/mysqld/mysqld.sock
- How do I grep recursively?
- how to find libstdc++.so.6: that contain GLIBCXX_3.4.19 for RHEL 6?
- How to extract C source code from .so file?
- subprocess.Popen(): OSError: [Errno 8] Exec format error in python?
- How to substitute shell variables in complex text files
- How can I recursively find all files in current and subfolders based on wildcard matching?
- Curl command for https ( SSL )
- “sed” command in bash
- How to exclude a directory in find . command
- How can I find all *.js file in directory recursively in Linux?
- Argument list too long error for rm, cp, mv commands
- Difference between using “chmod a+x” and “chmod 755”
- ssh: Could not resolve hostname [hostname]: nodename nor servname provided, or not known
- WSL – GEDIT Unable to init server: Could not connect: Connection refused
- Python subprocess.Popen “OSError: [Errno 12] Cannot allocate memory”
- Install tkinter for Python
- How to open some ports on Ubuntu?
- Given two directory trees, how can I find out which files differ by content?
- Uncompress tar.gz file
- What does it mean to mount a file system in linux?
- curl: (6) Could not resolve host: google.com; Name or service not known
- How to pass password to scp?
- scp gives “not a regular file”
- -bash: fork: Cannot allocate memory
- Explanation of polkitd Unregistered Authentication Agent
- CentOS error – sudo: effective uid is not 0, is sudo installed setuid root?
- Merge / convert multiple PDF files into one PDF
- scp from Linux to Windows
- Bash script: bad interpreter
- How do I find the MySQL my.cnf location
- PHP and mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
- How to grep and replace
- node.js: cannot find module ‘request’
- What is the reason and how to avoid the [FIN, ACK] , [RST] and [RST, ACK]
- What does “&” at the end of a linux command mean?
- wget returns “Unable to establish SSL connection”
- How to recursively download a folder via FTP on Linux
- error : storage class specified for parameter
- httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName
- How do I write stderr to a file while using “tee” with a pipe?
- How to include file in a bash shell script
- Does Mac OS X use Linux?
- bash sh – command not found
- Hosting multiple WordPress sites on single server – best practices?
- WordPress Update – This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php
- What permissions should my website files/folders have on a Linux webserver?
- Why is my crontab not working, and how can I troubleshoot it?
- Can I automatically add a new host to known_hosts?
- Why is “chmod -R 777 /” destructive?
- How can I run Debian stable but install some packages from testing?
- Environment variables of a running process on Unix?
- How to check if a library is installed?
- Is it normal to get hundreds of break-in attempts per day?
- How to cd into a directory with this name “-2” (starting with the hyphen)?
- how to disable SSH login with password for some users?
- How do I prevent accidental rm -rf /*?
- Is it possible to detach a process from its terminal? (Or, “I should have used screen!”) [duplicate]
- What does Virtual memory size in top mean?
- What’s the best way to check if a volume is mounted in a Bash script?
- How do I find the UUID of a filesystem
- Find out symbolic link target via command line
- Meaning of directories on Unix and Unix like systems
- How to handle security updates within Docker containers?
- How can I port forward with iptables?
- Why do we use a OS Base Image with Docker if containers have no Guest OS?
- Is it possible to make Nginx listen to different ports?
- REJECT vs DROP when using iptables
- Linux command line best practices and tips?
- How to run command as user who has /usr/sbin/nologin as Shell?
- How to make Windows 7 USB flash install media from Linux?
- How to get pid of just started process
- How to install/change locale on Debian?
- What limits the maximum number of connections on a Linux server?
- How to do the port forwarding from one ip to another ip in same network?
- How to disable everything in crontab -l?
- df says disk is full, but it is not
- What is the maximum port number?
- Linux – Is there a way to prevent/protect a file from being deleted even by root?
- How to sort ps output by process start time?
- What’s wrong with always being root?
- Is there a proper way to clear logs?
- Hundreds of failed ssh logins
- Transfer 15TB of tiny files
- What should I do when I got the KEYEXPIRED error message after an apt-get update?
- protocol version mismatch — is your shell clean?
- How do I join two named pipes into single input stream in linux
- How should an IT department choose a standard Linux distribution?
- Command line program to test DHCP service
- Service start request repeated too quickly, refusing to start limit