In Linux there is a single file system. Devices are mounted into this file system. (Use the command man mount to find out more.)
Don't forget to press q to exit the man command.
Now, let's create a directory, so type this:
mkdir ~/testdirectory, which will be explained later
To locate your position as a user of the file system, there is the concept of your current working directory. Linux only has one working directory per command shell.
File and Directory Naming
Relative naming means that files are named from some special directory: . current directory (Linux) .. parent directory (Linux) ~ home directory (some Linux shells) ~user home directory of user (some shells)
If just the name itself is given without any special prefixes (such as /, ., .., ~) then it refers to the file in the current working directory.
Let's go to our directory, type:
(Lets create a file, run:
touch temp.txt for later use)
cp [options] originalfile newfile (file to file) cp [options] files... dir (file to within a directory)
Now let's copy our file to the directory we created
cp temp.txt testdirectory
mv [options] original new
- let go back to our directory:
- and let's make sure our file is there:
- you should see testdirectory and temp.txt, otherwise go back make sure you don't skip the previous steps.
- rename the file:
mv temp.txt temp2.txt
rm [options] files...