You-Dont-Need-GUI
You-Dont-Need-GUI copied to clipboard
Most recommendations differ from what the GUI would do.
Most command examples currently shown do the operation way worse than what I'd expect thunar would do (and afair, does). Here's an attempt at fixing the most obvious differences.
-cp readme.txt documents
+cp --verbose --no-clobber --no-dereference --target-directory='documents' -- 'readme.txt'
stop right click and duplicate file
A core feature of the duplicate command is to automatically suggest an unused target file name, and prepare it in a way that helps users resume their work when they get distracted while deciding about the target file name. In that case they usually end up having a duplicate with the original name and a number, with content as it was at the moment they began their operation.
-cp readme.txt readme.bak.txt
+cp --verbose --no-clobber --no-dereference --no-target-directory -- readme{,.bak}.txt
copy a folder
-cp -R myMusic myMedia
+cp --verbose --interactive --recursive --one-file-system --target-directory='myMedia' -- 'myMusic'
duplicate a folder
-cp -R myMusic myMedia
+cp --verbose --interactive --recursive --one-file-system --no-target-directory -- 'myMusic' 'myMedia'
-mv readme.txt documents
+mv --verbose --interactive --target-directory='documents' -- 'readme.txt'
-mv readme.txt README.md
+mv --verbose --interactive --no-target-directory -- 'readme.txt' 'README.md'
-mv myMedia myMusic
+mv --verbose --interactive --target-directory='myMusic' -- 'myMedia'
-touch 'new file'
+magicmenu select-file-from /usr/share/file_templates/ --as %t \
+ --exec magicprompt suggest-filename --find-unused-suffix --basename %t --as %f \
+ --exec cp --dereference --no-clobber --no-target-directory -- %t %f
The mkdir examples are good, they even have quotes! :+1:
-stat -x readme.md
+# Ubuntu says: stat: invalid option -- 'x'
+du --bytes 'readme.md' && du --human-readable -- 'readme.md'
The {,xdg-}open examples are good. Missing quotes shouldn't usually be too much of a problem here.
For the zip example, consider -y
and quotes.
-rm my_useless_file
+rm -I --verbose -- 'my_useless_file'
-rm -r my_useless_folder
+rm -I --verbose --one-file-system --recursive -- 'my_useless_file'
You may wonder why I insist on quotes? You can easily clobber data without them. Forgetting the quotes usually causes the loudest anger when it happens with rm
. (Example: bumblebee. the accident, the fix)
The ls example is okay, although it requires some good shell aliases to have similar selection of folder views and select them with similar ease. For thumbnail view on a pictures folder in a graphics-enabled command line shell, the discussion about the boundaries of "GUI" are left for another thread.
Sorry for the title noise. I'll just stop and admit that I can't describe it as short as I'd have liked to: There are subtle but important differences in edge cases, and obvious differences in the usual cases.
Update: Also the recursive examples don't provide proportionate progress indication and estimated remaining time.
Those sounds reasonable. I'm not exactly sure how to do it though. Maybe we could add a longer version for each commands.
I think that's fair.
Maybe have two commands for each solution.
Copy a file
Novice
cp readme.txt documents/
Expert
cp --verbose --no-clobber --no-dereference --target-directory='documents' -- 'readme.txt'
Novices should be at least as concerned about safeguards like --one-file-system
, --no-clobber
and quotes (see bumblebee link). We should thus list the potential risks, or at least call it "Novice (potentially dangerous)".
It's definitely a good idea to have the silent or simple command and the lounder (and perhaps closer to what would happen on GUI) one.
I use mv -n
when combining folders, n is noclobber
Also consider adding zip -e
for "encrypt" (password protected) zip