First off, forget about trying to make a distinction between Konsole, Terminal, gnome-terminal, xterm and a long list of many others. They are all just a GUI X-server wrapper for running bash commands. They all run the same bash commands, the same way. Yes, there are differences between them in how the x-terminal window provides some functions, but that's not of much importance here if what you really need is to learn/understand basic bash commands.
Agreed. To a newcomer, many of "man command
" pages leave a lot to be desired in making it clear just exactly what is the proper command syntax to use. Very few of them give you example syntax so you can see exactly how the command line syntax is structured in various situations. But once you get more experience with usage and man pages, it does become a bit clearer as to what the man page is telling you. Even with my level of experience using bash (and I almost never use a GUI file manager, but rather the command line) I still come across a man page now and then that leaves me saying..."WTF", and I have no clue.
My best advice is to use Google. Yes, besides "man command
" typed into your terminal for the man page for whatever command
, there are also several online bash command line reference sites, most of which are just copies in html format of what you see when you type "man command
" in your terminal. But if you Google search using a term such as "how to move files using the mv command", you'll undoubtedly get a lot of links to sites that will give you working examples and better explanations.
The "mv" command can be pretty tricky at first to a new comer because the mv command is used to either rename a file or relocate a file, or both at the same time. And you can't do anything with commands that work on directories or files until you have a firm grasp on the Linux file system structure, so the very first thing you must learn is how the file system directory hierarchy is layed out and how to navigate the file system.
Everything starts with the root directory "/" (I'm not talking about roots directory, /root) and descends from there. The "ls" (list) command, by itself, lists the contents of your current working directory. The "pwd" (print working directory) command will show you the full path to what is your current working directory.
From your current working directory (lets say it currently /home/martin) you can either "ls" or "cd" (change directory) to any subfolder by simply specifying the directory name without having to give the "full" path.
CEF-daily Desktop Documents dosbox Downloads Music Pictures rpmbuild src Videos work
BASH:~/-> ls Documents
Files RPMS SpecFiles Tarballs
BASH:~/-> ls Documents/Files
Fixes General MaxPC PDF Xcel
And then to "cd" into the Documents/Files directory, simply:
BASH:~/-> cd Documents/Files
Fixes General MaxPC PDF Xcel
If you are not currently in your user home top directory, but want to go there, the "cd" command by itself will default to that directory. Use it to quickly return to your user home directory (/home/martin)
There are other bash shortcuts... "../" means cd up one directory. "../../" means change cd up two directories.
BASH:~/-> cd ../../
When "cd" to or "ls" a directory that is not an immediate sub-directory of your current working directory, then you need to specify the full path to it, beginning at the "/" directory.
When using the "mv" command to relocate (move) a file, specify the filename followed by the path to the directory where you want to file moved to. If the file is in your current working directory, use just the filename. It's it's somewhere else, specify the path to the file as well.
Use the TAB key for bash auto-completion. This will save a lot of time typing in the terminal. Type a partial path, then hit the TAB key. If what you already typed is unique, bash will complete the line, if it's not unique, hit TAB TAB, and bash will show you a list of all possible completions. This is especially useful when there are spaces in either directory or file names, or other "special" illegal characters which must be "escaped" (proceeded by a back-slash character).
DO NOT create directories or files in your user home directory as root. If you do, you will not have access to them as your regular user. If that happens, then you'll need to change to root (su, su - or sudo) and do a "chown" (change owner) of those root owned directories/files.
Hope this gets you on your way....