Questions tagged [touch]
touch is a command line utility to change file timestamps.
134
questions
0
votes
1
answer
35
views
Script to find multiple files and update their timestamps by a second
I'm trying to create an interactive script that lets me choose a start date and time, then recurse into the present directory/subdirectories, find all flac audio files, sorted by directory/...
1
vote
0
answers
69
views
Cannot touch a specific filename, but also cannot remove it [closed]
I'm using a linux terminal on a mounted drive which (according to df -Th ) is of type "cifs"; let's say I'm in directory /dir/. I created a file file_1. Then I deleted it, and now I want to ...
0
votes
1
answer
103
views
Fix the bogus modification time of some mkv files based on that of srt files with the same root name
I found around 50 mkv files with modification time in the future (year 2098 and 2097). I see that .srt files with the same name carry the right date and are located in the same subfolder as each mkv ...
7
votes
2
answers
1k
views
How to automatically set the modification (or creation) time of a Quicktime video file based on its meta data?
In a shell, how to automatically set the modification (or creation) date and time of a Quicktime video file based on the metadata in the file with a single command (or a single command line)? For JPG ...
1
vote
1
answer
3k
views
touch: /Users/username/.zshrc: No such file or directory
I'm on macOS Ventura 13.2.
Tried to fix python by adding it to .zshrc:
echo "alias python=/usr/bin/python3" >> ~/.zshrc
zsh: no such file or directory: /Users/username/.zshrc
Seems ...
1
vote
0
answers
186
views
How to change birth/creation time without copy the whole file?
In Btrfs, stat a file will show birth time, which I try to change but find the method is always about copying the whole file, that would be a time waste, it'd be good to change it like access, modify, ...
1
vote
0
answers
103
views
Linux touchscreen - touch indicator
Is there any package that adds a touch indicator similar to what is in windows 10/11. I mean such a gray circle that shows where you touch on the screen.
1
vote
0
answers
149
views
`touch` combined with `find -newer` behaves unexpected in script
Goal
I was looking for a simple way to check for new files.
As the target system is a minimal embedded Linux platform,
I cannot just install more packages.
Current Solution
A nice solution seemed to ...
2
votes
1
answer
290
views
touch/mkdir seems to ignore default ACL
I am pretty sure it is a stupid mistake but I can't seem to figure it out by myself, so please have a look.
I set up an ACL for the current folder like so:
zigbee2mqtt@nuc:/tmp/folder$ getfacl .
# ...
1
vote
0
answers
287
views
Dbus not starting on Ubuntu Touch
systemctl --user start dbus
Failed to start dbus.service: Process org.freedesktop.systemd1 exited with status 1
See user logs and 'systemctl --user status dbus.service' for details.
systemctl --user ...
3
votes
1
answer
291
views
Why am I not able to use * with touch in path? [duplicate]
This is the output of tree:
[xyz@localhost Semester1]$ tree
.
├── Eng
├── IT
├── IT_workshop
├── LA
├── OS
├── OS_lab
├── Psy
├── Python
└── Python_lab
9 directories, 0 files
I want to create 3 ...
0
votes
1
answer
360
views
How can I obtain the time stamp from a file or directory in touch format?
According to many websites I found online the touch commands' -t argument accepts the time stamp in the following format:
[[CC]YY]MMDDhhmm[.ss]
Here,
CC: The first two digits of the year.
YY: The ...
2
votes
1
answer
1k
views
Map touch display of the same type with xinput - which is which
on my Linux box I have 2 DELL touch display of the exact same type. One is connected on HDMI-2, the other on DP-1. To map the touch display I use
sudo xinput --map-to-output _ID1_ HDMI-2
sudo xinput -...
0
votes
1
answer
101
views
"touch" command with a working "-f" command-line option?
Older versions of the touch command offered a working -f command-line option, which could be used as follows:
touch -f file1 file2
With this command, the modification time of file2 could be set to ...
-4
votes
5
answers
5k
views
How do I create a file named \*\\'"Best School"\'\\*$\?\*\*\*\*\*:) on linux with touch command [closed]
I have had these issues for a while now. I've tried different approaches, all to no avail.
0
votes
1
answer
447
views
Copying / preserving symbolic link timestamp
I have been working on some projects on a GNU/Linux system and now they have been archived on a FreeBSD server. In the archive, I have rearranged some directories and now I noticed that some symbolic ...
1
vote
2
answers
342
views
How to make a for loop to read directory names with spaces in them?
I need to create a script to scan folders in a directory and take the name of each folder, make a .txt file, name it with the name of the folder and put inside that folder.
For example:
A directory ...
1
vote
0
answers
114
views
Draw with multiple fingers/styluses simultaneously on a touchscreen
I have a large touchscreen display that I would like to use for drawing with either my fingers or/and styluses.
I can do this perfectly fine under Android, multiple people can use the display at the ...
3
votes
2
answers
650
views
How to create a file for every directory on a tree?
For the following tree structure:
.
└── dir1
└── dir2
└── dir3
What would be a simple way to create a file (could be empty), for every directory, so the resulting tree will look like:
...
0
votes
0
answers
200
views
Visualizer for evtest logs
I'm looking for a tool that can visualize or make it a bit easier to interpret the logs that are produced from the evtest tool. I've googled for several times and could not find such a tool to ...
0
votes
1
answer
87
views
Will touch behave the same in all systems (overriding an existing file)?
Just a Cron test command to consider, create an empty file in the user's home directory every minute:
* * * * * touch ${HOME}/example.example
Will touch behave the same in all systems (overriding an ...
2
votes
1
answer
680
views
Why does using touch, to create an empty file with no filetype, create various kinds of files?
On macOS I am running a shell script that uses touch to create an empty file without an extension. The files created using the same script randomly have different Kinds, i.e. "Document", &...
0
votes
1
answer
2k
views
how can i touch "File Inode Change Date/Time" [duplicate]
i have an mp4 file and running exiftool i can see that the "File Inode Change Date/Time" tag changes when i touch it, but it changes to the current time and not to the date that i have ...
3
votes
2
answers
992
views
Can't specify file creation date
I would like to automate the creation of some files so I created a script.
I want also to specify the creation date of those files.
In a terminal for example, to create a file.txt with creation date ...
1
vote
0
answers
54
views
Execute a command on all folders that are older than their mirrored folder
Here is my problem. Every night I move data to a remote location, the data retains its modified date correctly, but the folders do not consistently. What I would like to do is to check the folders ...
1
vote
1
answer
334
views
Pipe vs Command substitution [duplicate]
Testing with the linux command line and pipe I tried to do echo {1..3} | touch and it doesn't work. I achieved the results with touch $(echo {1..3}).
Why I can't pass the list generated by echo to ...
-1
votes
1
answer
273
views
How to change all files in directory creation/modification date to 0/0/0?
I want to change all files in directory creation/modification date to 0/0/0.
I tried to use find $PWD -exec touch -m -d '0/0/0' {} + command.
-1
votes
1
answer
614
views
change last modification date for many files using references
I have performed a backup and on restoring it, unfortunately, all file access times were set to the timestamp of the DateTime of this restoring process.
How now to set all timestamps from the backup (...
4
votes
1
answer
174
views
A very strange behaviour of filesystem, Schrödinger's file
I'm fresh to Unix, and I would like to have your help with this strange behavior
I have a user directory /Users/den
den$ ls -la
total 208
drwxrwx---+ 19 den staff 608 18 Jan 16:35 .
drwxr-xr-x ...
6
votes
2
answers
1k
views
How to mirror directory structure and files with zero size?
I am trying to mirror the directory and file structure of a particular directory. However, I want the mirrored files to have no size. So for example, if I had the following directory tree:
...
0
votes
1
answer
358
views
Issue creating a regular file for a directory
I have tried this but it is not working
touch dir_practice ../cambridge/library/
touch dir_practice ./sample_dir/cambridge/library/****
0
votes
2
answers
2k
views
Force create nonexistent directory via vi or touch? [duplicate]
There are -p option in mkdir command to create parent directories as needed
wolf@linux:~$ tree
.
0 directories, 0 files
wolf@linux:~$
wolf@linux:~$ mkdir dir1/dir2/dir3
mkdir: cannot create ...
0
votes
1
answer
1k
views
Creating a new file and with a verbose switch
When creating a new directory using the mkdir command, I can simply add the -v option to find out whether or not the new directory is created. It saves time on not issuing a ls -F command. Is there ...
2
votes
2
answers
7k
views
Zsh: How to create a directory and file inside it with one command?
I am curious whether it is possible to create a directory and file inside this directory with one command, similar to mkdir -p but for a text file and intermediate directory.
I read through the touch ...
2
votes
1
answer
3k
views
cannot touch file: No such file or directory for a specific file
I know you have had many other doubts related to this same issue, but I have not found anything that would allow me to reproduce the same case that I had.
The situation is simple, I can do this:
$ ...
0
votes
0
answers
1k
views
Unable to write to a folder on a drive on AiX system
I logged in the server with the below user id.
myhost:hkgdb:/wd/user1>id
uid=214(user1) gid=321(dba) groups=1(staff)
I'm getting the following error while writing to a file:
myhost:hkgdb:/wd/...
0
votes
0
answers
571
views
What does "touch /reconfigure" before a reboot do?
We have a situation that spontaneous shutdowns are occurring on our Wind River Linux 6 system, and in the syslog, I see a /bin/touch /reconfigure followed by an /sbin/init 0. I can tell from another ...
-1
votes
1
answer
136
views
How to create directory and files inside the directory
I want to know how to place files using touch command inside an directory whether it is multiple or single file.help is appreciated
1
vote
2
answers
8k
views
touch: missing file operand with filename containing hash #
My system is
Kernel: 5.3.0-26-generic x86_64 bits: 64 Desktop: Cinnamon 4.4.8 Distro: Linux Mint 19.3 Tricia
Touch version is touch (GNU coreutils) 8.28
When the following command is given -
$ ...
-1
votes
1
answer
2k
views
Creating an empty file inside a folder
Does anyone know how to enter a Linux command to create an empty file called test1 in the directory systems while you are still in your home directory using the touch command?
4
votes
5
answers
4k
views
How do I create multiple files names from list.txt in bash?
I want to create multiple files at a time using names from a file list.txt, how can I do it?
Sample list.txt:
EOG090W002U
EOG090W00C1
EOG090W00DC
EOG090W00DE
EOG090W00E5
EOG090W00HR
EOG090W00MH
...
0
votes
1
answer
784
views
Qt and dual monitor with touch screen
I have a Qt-based program (using eglfs platform), and 2 monitors, one LVDS and the other one is connected by HDMI. The LVDS monitor is a touch screen.
The screen of HDMI is placed to the right of the ...
0
votes
1
answer
983
views
X11 and dual monitor problem
I have a customized linux (Debian, we've removed the desktop environment), where we run our application with X11. The screen size is 1024x768, and the app's window fills the screen.
Now the ...
7
votes
1
answer
6k
views
Change file "Birth date" for ext4 files?
Is it possible to change a file "Birth date" (according to the stat file "Birth" field)?
I can change the modification/access time with touch -t 200109110846 file, but can't find the corresponding ...
1
vote
2
answers
496
views
Create multiples files with brace expansion combining letters and numbers
I am trying to create a series of files with brace expansions. I want create the files fileA1 to fileZ100 with all possible combinations (Something like touch file[A..Z][1..100]).
If I run the ...
1
vote
1
answer
138
views
Why "*" works differently in different commands?
For example, in rm -r abc* "*" means any string. However, if we use it in touch abc* abcd* abcde* (and we don't have any files in directory starting with abc or abcd or abcde) "*" means just a symbol, ...
-3
votes
2
answers
938
views
How to create a file with specific command to run in linux?
I would like to create a file with:
name:
Hyper
command run:
"/opt/Hyper/hyper" %U
or
name:
Google Chrome
command run:
/usr/bin/google-chrome-stable --no-sandbox
( when we click in this icon,...
3
votes
2
answers
15k
views
Creating a file in Linux? (Touch vs Echo)
I'm pretty new to Linux in general, so I'm not too familiar with do's and don'ts of some commands.
I wanted to create a file and noticed that:
touch file.txt `
creates a file, but so does:
echo &...
1
vote
1
answer
230
views
How to create files from a list which contain space [duplicate]
I would like to create files from the following list.
There is no problem if the list doesn't have a space ... but the problem is it has a space
user@linux:~$ cat file.txt
Apples
Bing Cherry
Crab ...
0
votes
2
answers
1k
views
Build path name with variable as input to touch [duplicate]
I want to store a path I often use as an environment variable, then call this variable to construct a path name.
$ mypath="~/local/bin/"
$ newFile="${mypath}newFile.sh"
$ echo $newFile
~/local/bin/...