more and less Commands
| using more | |
|---|---|
| Spacebar | forward one page |
| Enter | forward one line |
| q | quit more |
| Using less | |
|---|---|
| Spacebar | forward one page |
| b | backward one page |
| up/down arrow keys | scroll line by line |
| Type /search-term and press Enter | to search for text |
| q | quit less |
Using touch
Common touch Command Examples
•Create a new, empty file: touch newfile.txt.
•Create multiple files: touch file1.txt file2.txt.
•Update an existing file's timestamp: touch existingfile.txt.
•Set a specific date/time for a file: touch -t 202401011200 file.txt (format: [[CC]YY]MMDDhhmm[.ss]).
•Only update the access time: touch -a filename.
•Only update the modification time: touch -m filename.
•Use a reference file to set time: touch -r reference_file target_file.
Key Details
•If a file exists, touch updates its access and modification timestamps to the current time.
•If a file does not exist, an empty file is created.
•The ls -l command can be used to verify that the file's timestamp has been updated.
Do I have btime? And other Debian timestamps
•mtime (Modification Time): Updates when the content of the file is modified (e.g., editing text in a document). This is the time displayed by ls -l.
•atime (Access Time): Updates when the file is read or accessed (e.g., opening a file to view it). Note: Some systems disable this to improve performance.
•ctime (Change Time): Updates when the file's metadata changes, such as permissions, ownership, or renaming.
•Birth/Creation Time (btime): Available on modern filesystems (ext4, XFS, Btrfs), this records when the file was created. It is shown via stat.