3 ms·
I have a problem with the very first entry: ``` cp readme.md documents/ ``` It misses the point of: "How did I get to the place where the "readme.md" file is
by phtrivier 6y ago
I have a problem with the very first entry:
```
cp readme.md documents/
```
It misses the point of: "How did I get to the place where the "readme.md" file is ? How did I know I wanted to put it in `documents/` ?
I'd argue that this is not what most users are really doing is.
A real-life scenario is:
1. I need to send a file to Bob. Where the hell is that file ? I think it's in the "Files" directory. No wait, is it in "Documents". Oh, ok, it's in "Project X254/Documents/Files/Revision0/VersionB".
2. Right-Click on Icon, Click Copy.
3. Where the hell do I need to put it, again ? Ah, ok, I need to put it in "Windows Share/Shared/Team/Multiple/Document/Files/Next Very Important Meeting"
4. Right-Click on Icon, Click Paste.
Using a CLI does not make steps 1 or 3 easier ; it makes step 2 and 4 unbearable (because you have to type _names_ right, and _names_ written by human beings are hard.)
- thomasahle 6y agoYou don't have to type the names, you only need the first character + tab. To me that's much faster than reading through a list of folders trying to find and click the right one. In case one of those folders only contain one other folder, you don't even have to type the first character, just tab+tab+tab done.
- noisem4ker 6y agoGraphical file managers can also select a file by typing the first few characters of its name (type-ahead)*. In case there's only one item, just press the down-arrow key to select it. One can navigate a GUI just like CLIs, just with slightly different keys, but with the added benefits of visualization and mouse actions such as drag-and-drop. Edit: * Unless you're using GNOME's Nautilus, which I think will stupidly trigger a recursive search instead.
- vergessenmir 6y agoOne of my favourite snippets of bashrc code for navigating directories below. Whether it beats navigating with a file explorer is up to you but I drastically prefer it. <code> export MARKPATH=$HOME/.marks function jump { cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1" } function mark { mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1" } function unmark { rm -i "$MARKPATH/$1" } function marks { ls -l "$MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo } </code> To bookmark a directory: $/home/user/Documents> mark To jump to it $/tmp> jump Documents source: https://datascienceworkshops.com/blog/quickly-navigate-your-filesystem-from-the-command-line/ https://datascienceworkshops.com/blog/quickly-navigate-your-... I can't find the orginal HN discussion on this but it has shown up a few times with incremental improvements like tab completions added.