Unix/Basic Linux Commands


Get the Flash Player to see this player.

Mark Video Segment:
[Hide] Copy and paste this link to an email or instant message:
[Hide] Right click this link and add to bookmarks:
Dock windowSearch
Loading ...

Title:Unix/Basic Linux Commands
Publisher:UT School of Information
Creator:Jessica Meyerson

Dock windowTranscript
Okay so today we're gonna do some command line basics, working in secure shell. We're gonna start by logging in so Quick Connect. I'm gonna use login.ischool.utexas.edu but is you have permissions on another server, like if you're in a class, you can use that one and mess around in terminal. Enter your user name. Click Connect. Enter your password. Okay we're logged in.
Okay, the first thing I want you to notice is you have your username@fiat and then you have a tilde and then you have where the terminal prompts you to begin typing. That tilde symbol tells you that you are in your home directory. So, when you first login, your current working directory is your home directory. Your home directory has the same name as your user-name, for example, datalore, and it is where your personal files and subdirectories are saved, or where they're located.
So to see what's in home directory, we're gonna use the command 'ls'. Now, commands are case-sensitive so make sure that you do lowercase letters. 'ls' stands for list. So, 'ls' lists the contents of your current working directory. So let's press Enter, see what's in there. Um, no there may be no files listed for you, there may be nothing in there...if you've never used your server space in which case the same prompt line is returned so that it looks like the computer didn't do anything, but it did perform a search it just didn't find anything. Alternatively, there might be some files that were inserted by the Systems Administrator when you frst created your account. (I believe your mail folders are created when you create your iSchool account.) So you can see what I have here: I have my two mail directories, my public_html directory and my survey of digitization folder AKA directory. And your folders are always going to be in a different color to highlight that that's what they are and as we'll see in a few minutes individual files are in plain black text.
Now, there are some files that 'ls' won't list for you and these are files that have a . or a .. in front of the file name. Those dots mean that they are hidden files. Typically hidden files are config files-meaning they contain configuration information. (They are hidden b/c youshouldn't mess with them unless you are an advanced user of either a Unix or Unix-like environment.)But 'ls' is a command that takes options and the options change the behavior of the command.So, to see all your files, including the hidden files, we'll use an 'ls' space '-a'. Specifying '-a' is going to list all of our files, including our hidden files. So let's type that in ls -a. So you can see the directories that showed up after our first search up here, they're highlighted in a different color and then we have these config files that have the dot in front. So, that's just for you to see what's going on there.
Another important trick to know in terminal is when you're starting to get confused, especially when if you are still in your first few experiences in terminal, you can always type in 'clear'. And that way you don't get confused by all the stuff listed above but that's just a nice way to keep you shell clean. 
Now the next thing we want to do is change directories. Remember the tilde symbol tells me that I am currently in my home directory. And I want to switch into one of the directories that were listed when we used our 'ls' command to list what was inside our home directory. One of the directories that was listed was my public_html folder and that's my destination, that's where I want to go.  So we're gonna use the 'cd' command, and 'cd' is short for 'change directories.' And then after 'cd' you want to put a space and you want to type your destination directory, which in this case, for me, is my 'public_html' folder. So now, as you ca see, what's in brackets (which tells me where I am) is myusername@fiat, but the tilde which indicates my home directory has been replaced by my current location which is my public_html folder. (Anyone who has taken either managment or databases will have a public_html folder. Anything you want to view live on the browser at a valid URL goes in this folder.)                                                             Now we can 'ls' our public_html folder to see what's in there. Okay, so it looks like I have one directory/one folder, which is my images folder and then I have several files.
Now I want to go back to my home directory and create a new folder, AKA directory, right along side my public_html folder.        Now, one way for you to do this to simply type 'cd' with no specified destination or directory name. So let's try that and see what happens. 'cd' then Enter and as you can see there's that tilde again which tells me that I'm in my home directory.                                                                                                                                                               Now another way to get back to our home directory is to type in 'cd' space and then that '~' symbol which all now know stands for  your home directory. And Enter. And there we go-we're back home. 
Now I want to create a new directory/folder in my home directory called group_project_docs.  Sice we're already home, we're gonna type in the command 'mkdir' (which is short for 'make directory'), space, followed by the name we want to give to the folder/directory which in this case is 'group_projects_docs.' Now we want to press Enter. Okay, it looks like nothing happened. Right? I mean all it did was return our current location and our cursor. But if we want to see if we actually created that new folder inside of our home directory, all we have to do is 'ls' again, Enter, and there it is. We created it. group_project_docs is a new folder in our home directory.
In the next terminal turorial we will cover creating a file inside a directory, moving a file from one directory to another, and deleting files from a directory.
Dock windowTable of contents
Where am I, again?
What's in my home directory? 'ls'
Folders versus files.
Hidden files.
How to get rid of all the junk in the buffer/terminal? 'clear'
Navigating to a different folder? 'cd destinationdirectory'
Two ways to navigate back home. 'cd' and 'cd ~'
Creating new folders. 'mkdir'
Checking to see if it was actually created. 'ls' again