Using Touch, Less and More

by Lance Gold

These are helpful to work with files and output on the Bash Command Line

Return to index

more and less Commands

you@de:~$ cat filename | more
using more
Spacebarforward one page
Enterforward one line
qquit more
Using less
Spacebarforward one page
bbackward one page
up/down arrow keysscroll line by line
Type /search-term
and press Enter
to search for text
qquit less

Using touch

from Google A.I.

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

From Google A.I.
Key File Timestamps in Debian

•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.