C Programming Tutorial 7 - Intro to UNIX/Linux - Part 2

submitted by mkenny400 on 03/19/18 1

In the last video we talked a bit about navigating around Linux. This video I wanted to go in a bit more depth. You can imagine the linux filing system as a tree. When you run pwd, you get the absolute path of where you are. There are important terms relating to paths that you should know. When someone says the root directory, they are referring to the very first directory. To get to the very first directory you can type: cd / Another important directory is called the home directory. This is the directory for your user. This is the default directory that opens when you open a terminal. There is an easier way to go to the home directory though: cd The tilde is a trick you can use that refers to your home directory. You can also reference stuff relative to the home directory. ls cd / cd ~/folderInHomeDirectory This introduces the concept of relative directories. We can reference a directory in relation to other directories. We actually already did an example of this when we did: cd .. This is saying to move one directory up. We don't necessarily have to start from the root directory. We can also get more complex… such as cd ~/directory ls ../.. cd ../../directory We are going a bit out of scope of intro to linux, so let's get back on track. Let's go to the home directory: cd we can create a file using: touch filename.c ls -la We can move a file using the mv command. For example: mv filename.c /Directory We can rename a file using this same command: cd /Directory mv filename.c test.c We can delete a file with: rm test.c I think we are going beyond the scope of this video though, so that's all I'm going to say for now. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HELP ME! www.patreon.com/calebcurry Subscribe to my newsletter: eepurl.com/-8qtH Donate!: bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: CalebCurry.com Facebook: www.facebook.com/CalebTheVideoMaker Google+: plus.google.com/+CalebTheVideoMaker2 Twitter: twitter.com/calebCurry Amazing Web Hosting - www.dreamhost.com/r.cgi?1487063 (The best web hosting for a cheap price!)

Leave a comment

Be the first to comment

Collections with this video
Email
Message
×
Embed video on a website or blog
Width
px
Height
px
×
Join Huzzaz
Start collecting all your favorite videos
×
Log in
Join Huzzaz

facebook login
×
Retrieve username and password
Name
Enter your email address to retrieve your username and password
(Check your spam folder if you don't find it in your inbox)

×