The Linux operating system is now commonly used as an alternative to Windows in software development companies and many other organizations as well. For instance, many Latin American government agencies use it extensively because of its open source nature.
This tutorial goes over the basics of Linux. The tutorial is geared for computer science students at USF and
for helping new students setup their system for the semester.
Your home directory will have your user name as part of its name and it should be represented with an icon on the Desktop. If you click on that icon, you'll see the subdirectories and files you have in a File Manager window. Some have been setup for you. You'll also want to create some subfolders yourself-- you can do this by selecting File | Create Folder.
When you create a file, you'll save it somewhere within the file hierarchy rooted at your home directory.
When you login to your CS account, your home directory is /home/yourUserName
For instance, Professor Wolber's is /home/wolber
You also have a web directory: /home/web/yourUserName
Files put into this directory are accessible to the public from any browser. You could put your homepage here.
lists the files in your current directory.
tells you where you currently are in the file system.
creates a new subdirectory called 'programs'
changes you from the current directory to the subdirectory 'programs' (if it exists). After running this command, try pwd again.
changes you from wherever you are to your home directory. Try pwd again to verify you are back in your home directory.
takes you up in the directory hierarchy, e.g., if you're in /home/wolber/programs, it will take you to /home/wolber.
changes your password. Do this.
Here's some more commands. You'll need them for the tasks set out below, but you don't need to try them right now. 'src' refers to the source of an operation, 'dest' to the destination of an operation.
cp src dest
copies a file named src to a file name dest.
mv src dest
moves a file from src to dest
removes a file (be careful)
removes a directory (be even more careful)
2. Create sub-directories within 'programs' to 'samples' and 'projects'. If you are still in your home directory, type:
‘samples’ is where you'll put program snippets you do in class that perform specific operations. ‘projects’ is where you'll put course projects you complete.
3. View your system setup.
cd this take you to your home directory
ls should list 'programs'
You can also view your directory hierarchy using the Linux graphical user interface.
Before proceeding, show your professor or TA that you have created the directories and can view them with the command-line and GUI.
4. Create a file with a text editor.
Select Applications in the upper left corner and choose Accessories | Text Editor. This is a simple wysiwyg text editor. Create a file
named me.txt. Put your name as the only line in it and save it in your home directory.
5.Copy a file
Open a terminal window and perform an ‘ls’. It should show "me.txt"
Copy the file into the programs subdirectory. From your home directory, enter:
cp me.txt programs/.
This means to copy me.txt (the source) into the subdirectory programs and keep the same file name ('.' means same name).
Navigate to the programs directory and make sure the file was copied.
6. Move a file.
Move the file to the samples directory using the mv command.
mv me.txt samples/.
ls me.txt should be gone
ls me.txt should be here
7. Delete the file