Presentation is loading. Please wait.

Presentation is loading. Please wait.

Eric Shook Department of Geography Kent State University

Similar presentations


Presentation on theme: "Eric Shook Department of Geography Kent State University"— Presentation transcript:

1 Eric Shook Department of Geography Kent State University
Basic Commands Eric Shook Department of Geography Kent State University

2 Commands – Changing and making directories
cd directoryname Change the current working directory to 'directoryname' (Note: this is relative to the current working directory) cd /home/eshook/directoryname Change the current working directory to /home/eshook/directoryname mkdir directoryname Make a new directory in the current working directory named 'directoryname' mkdir /home/eshook/directoryname Make a new directory in /home/eshook named 'directoryname' pwd Print the current working directory to the command-line (e.g., /home/eshook/directoryname)

3 Commands – Home directory
cd ~ Change the current working directory to your home directory, which will be /home/<username> mkdir ~/assignments Make a new directory in your home directory named 'assignments', which will be /home/<username>/assignments

4 Commands – Navigating directories
.. Parent directory . Current working directory / Root ../adifferentdirectory Sister directory ../.. Grandparent directory ./adifferentdirectory/anotherdirectory/../..

5 Commands – Listing files and directories
ls List contents of current working directory ls -a List all contents (including hidden files denoted with a .<something>) of current working directory ls directoryname List all contents in the directory named 'directoryname' (Note: This is relative to the current working directory ls .. List all contents of the parent directory (Note: This is relative to the current working directory ls /home/eshook List all contents of /home/eshook (Note: This is absolute and not relative to the working directory)

6 Commands – Copying files
cp originalfile newfile Copy the file 'originalfile' in the current working directory to 'newfile' in the current working directory. Two copies of the files remain. cp /home/eshook/originalfile newfile Copy the file located in /home/eshook to newfile in the current working directory cp ~/originalfile newfile Copy the file located in my home directory to newfile in the current working directory

7 Commands – Moving files
mv originalfile newfile Move the file 'originalfile' in the current working directory to 'newfile' in the current working directory. Only one copy of the file remains. mv originalfile directoryname/originalfile Move the file 'originalfile' in the current working directory to the directory named 'directoryname' mv originalfile ../anotherdirectory/originalfile Move the file 'originalfile' in the current working directory to a sister directory

8 Commands - Removing files and directories
rm filename.txt Delete (remove) the file named 'filename.txt' in the current working directory rm directoryname/filename.txt Remove the file in 'directoryname' named 'filename.txt' rmdir directoryname Remove the directory named 'directoryname' in the current working directory rmdir /home/eshook/directoryname Remove the directory named 'directoryname' in the directory /home/eshook

9 Commands - Removing files and directories
WARNING! WARNING WARNING! There is no recycling can or 'unrm' or 'undelete' BE CAREFUL OR YOU CAN DELETE YOUR HOMEWORK OR PROJECT! rm filename.txt Delete (remove) the file named 'filename.txt' in the current working directory rm directoryname/filename.txt Remove the file in 'directoryname' named 'filename.txt' rmdir directoryname Remove the directory named 'directoryname' in the current working directory rmdir /home/eshook/directoryname Remove the directory named 'directoryname' in the directory /home/eshook

10 Commands – saving time <Tab> will autocomplete a command or filename <Tab><Tab> will list the set of commands or filenames if multiple choices are available <Up> the up arrow can be used to iterate over previous commands you have typed history – the history command will list the most recent commands you have typed (over a thousand)


Download ppt "Eric Shook Department of Geography Kent State University"

Similar presentations


Ads by Google