this post was submitted on 12 Jul 2023
14 points (85.0% liked)
Linux
48224 readers
102 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Chatgpt is your friend here. ;)
Probably I'm misreading it, but isn't this kind of answer basically saying "google it"?
I don't want to sound rude, but my english is kind of failing me, I'm just curious, but what's the point?
One of the reasons of this kind of public forum is to share knowledge and experiences. ChatGPT is a closed, private, garden where the answer will just die.
I could get a "I don't really know the answer but I used ChatGPT and it gave me this:" followed by a script, or something like that.
I know, this is off-topic and I'm sorry, I'm just really interested in Why, considering it's said multiple times in this comment section.
chatgpt is built on the foundations of stackoverflow etc. therefore yeah it is kind of googling it.
however the nature of the generative approach of chatgpt gives you tailored answers.
when you google your question you get abstract answers for other related questions. with an explanation of how doing it. e.g. when I dont understand something but want to I will google it - to gain knowledge.
but with chatpgt you can specify - hey I want a functiom that does this and that in prints me a string/double using that format. chatpgt gives me exactly what I want - without fiddling with format strings etc. anithet example is regex. for my field of experience I am no core developer, therefore for me everything is a tool to get what I want. chatpgt can give this me in a more comfortable way. I dont need to master regex. but it is very helpful. therefore Im outsourcing that kind of work.
I agree that for a general standpoint this is valid. however for such simple questions we do not need new forums asking about the already discussed stuff. this is just repetition and we do not like duplicates (which is why forum rules are strict about this)
so I dont see any issue here.
that is the total responsibility by the user and has nothing to do with chatgpt. its the same as running ambiguous linux commands as sudo. its not the fault of stackoverflow, the reddit thread or linus itself. its the users fault.
therefore if such thing you mentioned happens. but it can be rejected - one should now about the culprits and strenghts of chatgpt.
edit: as you can see the top voted comment is a human made answer (could also be a chatpgt bot?).
so we are not yet doomed. ;)
Let's see
Hi @[email protected] , write a bash script that extracts date of modification including seconds from all .jpg and .mp4 files in the current directory and prints it out
cool thing. I assume it works by piping the linked comments to the API, with the private API key of the bot maker?
AFAIK no and yes ;)
It sends only the comment where the bot is referenced (no context, no chaining. Each comment is a separate prompt) and it does use the private account of the creator. In the topic where it got announced you can see that at some point it ran out of limit and started generating using 3.5
right. makes sense. thanks for digging into this monster thread tho.
may your day be blessed.
Sure, here is a simple Bash script which uses the
stat
command to get the modification time of files. It looks specifically for.jpg
and.mp4
files in the current directory and prints out the modification date and time, including seconds:This script will print out the filename along with its modification date for each .jpg and .mp4 file.
You can use this script by saving it in a file (for example,
filedate.sh
), making it executable withchmod +x filedate.sh
, and running it with./filedate.sh
.Please note that the date format of the
stat
command can vary based on your system. The%y
format outputs the last modification time in human readable format (yyyy-mm-dd hh:mm:ss.sssssssss +zone
). You might need to adjust this if you are using a system wherestat
behaves differently.Also keep in mind that this script does not traverse directories recursively. It only looks for the specified files in the directory where it is executed. If you need to perform this operation on files in subdirectories, you will need to modify the script slightly or use a different approach.
@[email protected] does it look like something you are looking for? The check for file existence is unneeded IMO and using the
file
variable name occludes another binary but in this case it shouldn't hurt the executionIt literally is. This is a great use case for going down the chat gpt approach. It will help you throw together a script for this quickly.
yeah but in 80% of the time the less complex solutions are more quickly resolved using chatgpt.
waiting for another human is not instantaneous.
for simple code snippets chatgpt can give you a really nice performance boost. plain routines where there is more syntax to write than actual cognitive thinking to do can be perfectly outsourced.